chore(activities): reroute CreateActivityDialog through TicketApiService.createEvent #83
No reviewers
Labels
No labels
app:activities
app:chat
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!83
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "chore/delete-activities-nostr-service-publish"
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?
Summary
The
aiolabs/eventsextension on itssigner-abstractionbranch (commit66076d6) constructs and publishes kind-31922 NIP-52 calendar events server-side viaNostrSigner—POST /events/api/v1/eventsaccepts aCreateEventRequestpayload, signs through the operator's signer, and broadcasts to configured relays. The webapp no longer needs to sign calendar events client-side.This is webapp's second bucket-A leg per
aiolabs/lnbits#9phase-1.Changes
src/modules/activities/services/ActivitiesNostrService.tspublishCalendarEvent()method and its helper imports (finalizeEvent,EventTemplate,buildCalendarTimeEventTags, the localhexToUint8Arrayfunction).useActivities,useActivityDetailconsumers).src/modules/activities/components/CreateActivityDialog.vueSwap the publish flow:
ActivitiesNostrServiceinjection +currentUser.value.prvkeyread.TicketApiServiceinstead; pullinvoiceKeyfromcurrentUser.value.wallets[0].inkey(same pattern asEventsPage.vue:71handleCreateEvent).CreateEventRequestwithamount_tickets: 0, price_per_ticket: 0. The events extension treats 0 as "unlimited / not ticketed" permodels.py:45-46(verified in lnbits'slog:2026-05-28T22:30Zaudit).summary + descriptioninto the events extension'sinfofield sinceCreateEventRequesthas no separate summary slot."Activity created!"(server publishes to relays via the signer; webapp doesn't sign).Approval-workflow caveat (documented inline + in this PR description)
Non-admin users on instances where the events extension has
auto_approve=false(the default) land in the proposal queue when they submit a new activity. The event isn't published to relays until an admin approves it. Admins (and instances configured withauto_approve=true) publish immediately.This is the intended new behavior — operators can flip
auto_approve=trueon the events extension config per-instance if they want the legacy direct-publish moderation posture. The webapp'suseApprovalState.tsflow already surfacesproposedevents to their owners (fetchMyEventswithall_wallets=true), so a non-admin who submits to the proposal queue still sees their event in the "My events" tab, just labeled appropriately.Diff stat
What's NOT in this PR
User.prvkeyfield removal — atomic phase-1 final PR per design doc Q1.2 Option (b). Other webapp sites (chat, forum, nostr-feed, etc.) still readcurrentUser.value.prvkey; those bucket-B sites intentionally break when the field is removed, which is the design-intended pressure mechanism that forces phase-2 to start.auto_approvetoggle to operators in the webapp settings, that's a separate UX initiative.Server-side compensation (confirmed live on
aio-demo)POST /events/api/v1/eventsCreateEventRequest; creates DB row + (if approved status) callsnostr_publisher.publish_event_to_nostr(event, signer)→ kind-31922 published via the operator'sNostrSigneramount_tickets: 0models.py:45-46);nostr_publisher.pycorrectly omits thetickets_availabletag (distinguishes "unlimited" from "sold out")views_api.py:283-285— non-admin +auto_approve=false→proposed, no relay publish until admin approvesTest plan
vue-tsc --noEmitclean post-changeaio-demoafterdevdeploy:proposedstatus); no relay publish yet; once admin approves, kind-31922 lands on relaysuseActivities/useActivityDetailare unchanged)CreateEventDialogis unaffected (different consumer)Refs
log:2026-05-28T22:30Z— lnbits Q2.1 audit verifying ticket-less acceptance + approval-workflow caveat~/dev/coordination/webapp-design-questions.mdQ2.1 (full decision context)aiolabs/eventssigner-abstractioncommit66076d6(server-side publish via signer)aiolabs/lnbitscascade tip861f427cdeployed toaio-demo(server-deploy:e2eed9c)aiolabs/lnbits#9(signer abstraction / bunker integration)#80ReactionService dedup — merged#81ScheduledEventService dedup — merged#82nostr-metadata-servicedeletion — open🤖 Generated with Claude Code
The aiolabs/events extension on its signer-abstraction branch (commit 66076d6) constructs and publishes kind-31922 NIP-52 calendar events server-side via NostrSigner — POST /events/api/v1/events accepts a CreateEventRequest payload, signs through the operator's signer, and broadcasts to configured relays. The webapp no longer needs to sign calendar events client-side. Changes: - ActivitiesNostrService.ts: delete publishCalendarEvent() and its helper imports (finalizeEvent, EventTemplate, buildCalendarTimeEventTags, the local hexToUint8Array). The subscribe / query paths stay — the service still reads NIP-52 events off relays for the activity feed. Docstring updated to reflect the read-only role and point at the events extension for the publish path. - CreateActivityDialog.vue: swap the publish flow. - Drop ActivitiesNostrService injection + currentUser.value.prvkey read. - Inject TicketApiService instead; pull invoiceKey from currentUser.value.wallets[0].inkey (same pattern as EventsPage.vue handleCreateEvent). - Build CreateEventRequest with amount_tickets: 0, price_per_ticket: 0 (events extension treats 0 as unlimited/not-ticketed per models.py:45-46 per lnbits 22:30Z audit). - Fold summary + description into the events extension's `info` field since CreateEventRequest has no separate summary slot. - Update toast on success to "Activity created!" (server publishes to relays via the signer, not the webapp). Approval-workflow caveat documented inline in the submit handler: non-admin users on instances with auto_approve=false (the default) land in the proposal queue and don't publish to relays until an admin approves. Admins / auto_approve=true instances publish immediately. This is the intended new behavior — operators can flip auto_approve on the events extension config per-instance if they want the legacy direct-publish moderation posture. This is webapp's second bucket-A leg per aiolabs/lnbits#9 phase-1. The remaining `currentUser.value.prvkey` reads stay until the atomic User.prvkey field-removal PR (Q1.2 Option (b)). Refs: - log:2026-05-28T22:30Z (lnbits Q2.1 audit verifying ticket-less acceptance + approval-workflow caveat) - ~/dev/coordination/webapp-design-questions.md Q2.1 - aiolabs/events signer-abstraction commit 66076d6 (the server-side publish path) - aiolabs/lnbits cascade tip 861f427c deployed to aio-demo Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>26a661891ato531de18ad7531de18ad7toba916a4c37ba916a4c37to141e59da82