fix(nostr): always publish tickets_available, zero is not unlimited #62
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/zero-capacity-is-not-unlimited"
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?
Refs #34 — the first of its two remaining halves. Not
Closes; see the blocked half below.Omitting
tickets_availablemeant "unlimited capacity". Nothing else in the codebase agreed.api_get_event:287andapi_ticket_create:678both treatamount_tickets < 1as sold out. So a zero-capacity event advertised "Unlimited tickets" on the card while both the detail page and the purchase returned 410.Observed live on aio-demo
Three approved, publicly listed, free events in exactly that state. For
PKBVuusKikfJFU4PYGtBTW("Alpaca Therapy"):Listed in
/events/api/v1/events/publicthroughout, sinceget_public_eventsfilters on status andcanceledonly.The admin form was actively recruiting organizers into this state —
min="0"withhint="0 = unlimited". Both corrected here.The fix
Always emit the tag; zero reads as sold out, which is what every other reader already believed.
Clients that must handle an absent
tickets_available— a NIP-52 calendar event from some other publisher — are unaffected, because we simply never omit it. The webapp'savailable === undefined → "Unlimited tickets"branch stays as the foreign-event fallback, as agreed on #34.Testing
96 passed(91 + 5 new). Three of the five fail without the change. ruff and black clean.What's still blocked, and why
Making
amount_ticketsrequired — the rest of #34 — cannot land yet. The webapp's create dialog omits the field on a falsy value:A server-side
ge=1would therefore 422 the webapp for precisely the case users currently choose. Webapp first, then this.Separately — the webapp has the #59 bug
Worth flagging loudly since it's live and #59 didn't reach it.
MyEventsPage.vuestill does the double-subtraction the backend just stopped doing:So the backend now sells correctly while the webapp disables the buy button at half capacity. Filing that against
aiolabs/webapp; it's more urgent than the required-capacity change.Deploy note
Existing zero-capacity rows are not migrated — we cannot guess whether the organizer meant "unlimited" or forgot to set a number, and they are already unsellable. After deploying, they will correctly read as sold out once something republishes them; the #55 sweep will not flag them on its own, so
/republish-allis the way to refresh. Organizers can then set a real capacity by editing the event.