fix(forms): guard TemplateResourceForm's kind-30142 publish (#72) #73
No reviewers
Labels
No labels
bug
discussion
enhancement
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
edufeed/edufeed-app!73
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/template-resource-form-publish-guards"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #72. Found by TestOER, measured at
e0aa0aba.Two changes, both the pattern the rest of the app already uses after #62/#64:
created_at: nextCreatedAt(resourceEvent)in edit mode — without it a replacement can tie with what it replaces, and on a tie nostr-idb keeps the OLD one deterministically.eventStore.addmoved to after a successful publish, viacachePublishedEvent.publishEventhas no failure path (unlikepublishEventOptimisticit never removes or un-caches), so an add placed before it has nothing to undo it. Kind 30142 is cacheable, so that left a version existing on no relay cached at its address.A total publish failure now surfaces as an error instead of navigating to the new naddr as though it had worked.
Verification
Not covered by a new test — stated plainly
Driving this component's submit needs
decodeFormNaddr,parseFormTemplate,addressLoader, the event factory,publishEventandbuildTemplateResourceSubmissionall mocked. The two behaviours are already unit-tested on the helper (replaceableUpdates), but that this component calls them is unproven in CI. TestOER's T1/T2 at this commit is what should confirm it.