MyEventsPage disables the buy button at half capacity (same bug as events#34) #173
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#173
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?
MyEventsPage.vuesubtractssoldfromamount_tickets, but those count the same tickets — the backend decrementsamount_ticketson every sale and incrementssold. Doing both removes each sale twice.This is the frontend copy of
aiolabs/events#34. The backend half shipped inaiolabs/events#59(v1.6.1-aio.17), so the server now sells correctly while the webapp refuses to let people buy.Impact
Because
amount_tickets + soldis the original capacity,amount_tickets <= soldfirst becomes true at exactly the halfway point. So the purchase button disables itself once an event has sold half its seats, and "Tickets Available" under-reports the whole way there.Measured on aio-demo, 16 of 24 live events are in the affected range and 3 are already past the threshold:
The backend confirms those are sellable —
POST /events/api/v1/tickets/KVhCGUrGFP6UyBuEaRA5Zdwith quantity 10 returns "Only 9 ticket(s) remaining", not sold out.Fix
amount_ticketsis the remaining count. Don't subtract:Worth grepping for the same pattern elsewhere in the module while in there.
EventDetailPage.vueandEventCard.vuereadticketInfo.available(straight from thetickets_availabletag) and are correct; this page reads the RESTEventshape instead, which is how it diverged.Second, smaller change — needed to unblock events#34
CreateEventDialog.vue:432omits the field on a falsy value:So a capacity of
0is dropped from the payload entirely.aiolabs/eventswants to makeamount_ticketsrequired (ge=1) — the other half of events#34 — and that would 422 this dialog for exactly the case users currently pick. Changing the check to an explicit!== undefined(and eventually requiring ≥1 in the zod schema, currently.min(0).default(0)) unblocks it.Ordering: this issue ships first, then the events-side
ge=1.Context
Zero-capacity events are being fixed backend-side in
aiolabs/events#62— they previously advertised "Unlimited tickets" on the card while the purchase returned 410. Theavailable === undefined → "Unlimited tickets"branch inEventDetailPage.vuestays as the fallback for NIP-52 events published by other clients, which is deliberate.