chore(api): remove User.prvkey field + thread-through helpers (Q1.2 Option b) #84
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!84
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "chore/remove-user-prvkey-field"
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
Atomic phase-1 final per design-questions
Q1.2Option (b) and the consolidated decisions inlog:2026-05-29T00:30Z. Removingprvkey?: stringfrom theUserinterface flips the type system into the pressure mechanism that forces phase-2 to start: every remaining bucket-B sign-site (chat / forum / nostr-feed / activities-bookmarks/RSVP / market / tasks) now failsvue-tscuntil it migrates tosignEventViaLnbits()againstPOST /api/v1/auth/sign-event(aiolabs/lnbitsPR #29, deployed onaio-demo).This is part 3 of a stacked PR chain:
#82 → #83 → this PR. Deploying this branch's tip exercises all three changes at once.Changes
src/lib/api/lnbits.ts:prvkey?: stringfromUserinterface.getCurrentUser():/auth/nostr/meused to mergeprvkeyalongsidepubkey; post-cascade the endpoint returns only the pubkey. Updated the comment + cleaned the merge object.src/modules/base/auth/auth-service.ts:updateProfile()no longer threadsprvkeythrough the merge. Server-sidePATCH /authpublishes kind-0 via the signer per869f67c3; the webapp doesn't keep prvkey at all.src/modules/nostr-feed/components/NostrFeed.vue+ScheduledEventCard.vue:ScheduledEventtype import from the deleted../services/ScheduledEventServiceto@/modules/tasks/services/TaskService. Trivial post-#81-merge cleanup that fell through the dedup PR; same file exports the same interface.vue-tsc --noEmitafter this commit: 8 errors, allTS2339 "Property 'prvkey' does not exist"The failing sites are exactly the bucket-B targets the design doc enumerates as phase-2 migration work:
activities/composables/useBookmarks.ts:92,113activities/composables/useRSVP.ts:153,187base/services/NostrTransportService.ts:100,112market/composables/useMarket.ts:455nostr-feed/components/NostrFeed.vue:408NOT caught by vue-tsc but still bucket-B
The BaseService injection pattern types
this.authServiceasany, so optional chaining (this.authService?.user?.value?.prvkey) bypasses the type check. These sites will runtime-fail (prvkey is undefined from the API post-cascade) but won't surface at compile time. Phase-2's per-module migration (Q5.2) catches them as each module flips.chat/services/chat-service.ts:341, 511, 714forum/services/SubmissionService.ts:755, 1167nostr-feed/services/SubmissionService.ts:769, 1226nostr-feed/components/NoteComposer.vue:306nostr-feed/components/RideshareComposer.vue:423tasks/services/TaskService.ts:507, 562, 616⚠️ This PR intentionally breaks the build
The webapp WILL NOT BUILD CLEANLY after this PR merges to
devuntil phase 2 lands. That's the intended trade-off perQ5.1+Q1.2; the broken-build interval is the design-intended pressure mechanism to start phase 2.server-deploy'swebapp-demoflake.lock bump will fail until phase 2 lands; demo stays on the pre-PR webapp during that interval.Phase-2 gate
Per lnbits's
log:2026-05-29T20:30Zaudit, the gate for phase-2 webapp bucket-B PRs is:aiolabs/lnbits#31merges — env-pinnedlnbits_cors_allowed_origins: list[str]allowlist, switches CORS from wildcard to explicit allowlist +Access-Control-Allow-Credentials: truewhen populated.server-deploy:flake.lockbumpslnbits-devto pull #31.services.lnbits.env.LNBITS_CORS_ALLOWED_ORIGINS = ["https://demo.aiolabs.dev"]set onaio-demo../deploy.sh aio-demoverifiesOPTIONS /api/v1/auth/sign-eventreturnsAccess-Control-Allow-Origin: https://demo.aiolabs.dev+Access-Control-Allow-Credentials: true.Why CORS-only, no SameSite changes:
aiolabs.devis not on the Public Suffix List, sodemo.aiolabs.devandlnbits.demo.aiolabs.devare same-site →SameSite=Laxcookies including thecsrf_tokenalready ride cross-subdomain cleanly. The CORS adaptation is the only thing needed because/auth/sign-eventusescredentials: 'include'for the CSRF double-submit, which forbids wildcard origin.Stacked PR chain context
This PR's base is
chore/delete-activities-nostr-service-publish(#83), NOTdev. The stack:dev→#82chore(base): delete nostr-metadata-service→#83chore(activities): reroute CreateActivityDialog through TicketApiService.createEvent→#84(this PR)chore(api): remove User.prvkey field + thread-through helpersTo test all three together on
aio-demo, bumpservices.webapp.src(or equivalent flake input) to point at this branch's tip (85fc83c). The diff this PR shows in Forgejo is just the prvkey-removal piece (its base is #83's rebased tip).When the stack merges in order (#82 → #83 → this),
devends up with all three changes.Test plan
vue-tsc --noEmit -p tsconfig.app.jsonshows 8 expectedTS2339 prvkeyerrors at the bucket-B sites listed above. NO other errors.aio-demoviaserver-deployflake bump:signEventViaLnbits()(separate work, lnbits's#31CORS allowlist must land first)Refs
log:2026-05-29T00:30Z— consolidated decisions; Q1.2 Option (b) + Q5.1 risk acknowledged (demo gap acceptable)log:2026-05-29T17:30Z— lnbits confirming this PR stays atomic-after-the-two-bucket-A PRslog:2026-05-29T20:30Z— lnbits CORS-only audit result (SameSite changes not needed thanks to PSL)~/dev/coordination/webapp-design-questions.mdQ1.2 + Q5.1 + Q3.1.6 (updated for CORS-only gate)aiolabs/lnbits#9(signer abstraction / bunker integration)aiolabs/lnbits#31(CORS allowlist)#82(open),#83(open, rebased on #82's branch)🤖 Generated with Claude Code
85fc83cb42tobe182cff3fbe182cff3fto1a0738576a1a0738576ato9a300c1679