Ticket total is derived as available + sold — inflates on every organizer edit #143
Labels
No labels
app:activities
app:chat
app:chatelet
app:events
app:forum
app:libra
app:market
app:restaurant
app:tasks
app:wallet
app:webapp
bug
enhancement
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
aiolabs/webapp#143
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Client-side half of
aiolabs/events#34. Postponed for now; filing so thewebapp changes aren't lost when the backend fix lands.
Symptom
The "Transhumance of the Merens" event on aio-demo renders
"10 of 17 tickets left" for an event the organizer set to 10 tickets.
The number climbs by
soldevery time the organizer edits the event.Cause
src/modules/events/types/event.ts:98reconstructs the total byaddition, because the NIP-52 event never publishes one:
That identity only holds while
tickets_availableis strictly decrementedby sales. The backend also lets organizers overwrite it wholesale, which
re-baselines remaining and inflates the derived total by
sold. Fullmechanism and drift history in
aiolabs/events#34.Rendered at:
src/modules/events/components/EventCard.vue:248src/modules/events/views/EventDetailPage.vue:350both via
events.detail.ticketsRemainingOfTotal({count} of {total} tickets left).The form field feeds the same confusion
src/modules/events/components/CreateEventDialog.vue:619-625labels theinput simply "Tickets" with helper text "0 = unlimited", and
:248prefills it from the raw backend value:That value is remaining, not capacity. An organizer with 7 sold sees
9, reads it as "capacity 9", corrects it to10, and silently setscapacity to 17. This is how the demo event drifted.
What to change once the backend lands
aiolabs/events#34proposes publishing an explicittickets_totaltagand keeping the organizer input as "tickets still available for sale"
(so
capacity = sold + inputmakes capacity-below-sold structurallyimpossible). On this side that means:
tickets_totalinparseTicketTags(
src/modules/events/types/nip52.ts:132) and add it toTicketTags.ticketTagsToInfo(event.ts:89), keepingavailable + soldonly as a fallback for events published before thechange — old relay copies will never gain the tag.
settles on, and revisit the "0 = unlimited" helper text: under the
proposed model
0means "stop selling", which is not the same thing.No webapp change is worth making before the backend decision is final —
the parsing and the label both depend on it.
Related
aiolabs/events#34— capacity semantics (root cause)aiolabs/events#35— swallowed publish failures, which independentlylet stale counters sit on the relay