market: self-heal orphan stalls — re-publish kind-30017 when user has merchant but no stall on relay #38
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#38
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?
Summary
Stopgap for the upstream bug tracked in
aiolabs/lnbits#<TBD>—_create_default_merchantwrites the merchant + stall to nostrmarket's internal SQLite but never publishes the kind-30017 stall event to relays. Until that's fixed and rolled out, our webapp can self-heal by republishing the missing stall on behalf of any logged-in user it detects in this state.Why we need our own fix
Acceptance criteria
When a logged-in user lands on
/market/dashboard(or any merchant view), do this once per session:auth.currentUser.value.pubkey.GET /nostrmarket/api/v1/stallto list this user's stalls.PUT /nostrmarket/api/v1/stall/{stallId}with the existing stall data — this triggerssign_and_send_to_nostrserver-side and republishes.console.infoso we can see it in DevTools.Suggested implementation
useMarketStallSelfHeal()undersrc/modules/market/composables/MarketDashboard.vueonMounted(after the existing fully-authed check we just added)injectService(SERVICE_TOKENS.RELAY_HUB)for the relay query andinjectService(SERVICE_TOKENS.NOSTRMARKET_API)for the LNbits round-tripssessionStorageso we don't re-run on every dashboard mountOut of scope
Companion
Upstream LNbits issue:
aiolabs/lnbits#<TBD>—_create_default_merchant: missing kind-30017 stall publish to relays. Both should be tracked together.