Skip to content

Get paid: keep Lock Server Step 1 connected after the browser token expires - #114

Merged
BitcoinErrorLog merged 4 commits into
release/shop-v0.6.8from
cursor/locks-status-carryover-27ae
Sep 24, 2026
Merged

BitcoinErrorLog merged 4 commits into
release/shop-v0.6.8from
cursor/locks-status-carryover-27ae

Conversation

@BitcoinErrorLog

Copy link
Copy Markdown
Owner

Summary

Fixes pubky-marketplace#55: Get paid Step 1 looked “Not set up” after the Lock Server connection was still valid on the server.

Cause: Step 1 trusted only a Lock Server frontend session token in this browser’s localStorage (pubky.marketplace.locks-frontend-session.v1). That token expires 24 hours after connect, is cleared on Shop sign-out / failed restore, and is absent in other browsers. When it is missing or rejected, the Shop showed Open Locks connect without checking whether the Lock Server still holds the seller’s authority.

Change: If there is no live frontend token, Step 1 calls the Lock Server public route GET /creators/{creator}/authority-status (yes/no only: { creator, authorized }) for the signed-in pubky. When authorized is true, Step 1 stays Connected — no reconnect required for carry-over.

Before locks ships: Production Lock Server still returns 404 for that route. In that case (or if the route is unreachable), Step 1 shows a plain note: approve once more, why a fresh approval may be needed, and that doing so does not reset setup.

Dependency: Requires BitcoinErrorLog/locks#2 on the Lock Server. Until both are deployed, carry-over from authority alone is not live in production.

Evidence: ROOT-CAUSE.md. Head: e2e3e156 on cursor/locks-status-carryover-27ae.

…n is gone

Step 1 read its status only through the 24-hour Lock Server frontend
session kept in this browser. Expiry, sign-out cleanup, or another browser
dropped it to Not set up while the Lock Server still held the seller's
creator authority (#55).

Without a live session the hook now asks the Lock Server's creator-keyed
status for the signed-in account. A Lock Server that does not serve that
route, or cannot be reached, gets a plain note under Step 1 that explains
the fresh approval and that it does not reset setup.
…set up

A 5xx or unanswered authority-status check, on either the authenticated or
the creator-keyed route, now leaves Step 1 on a plain note that the check
could not run and to reload, with the card at Needs attention. The stored
Lock Server sign-in is kept for the retry.
@BitcoinErrorLog
BitcoinErrorLog merged commit 845935e into release/shop-v0.6.8 Sep 24, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant