fix(web): handle archived bindings gracefully and add restore workflow (#186) - #344
Merged
blockchain-maxis merged 3 commits intoSep 2, 2026
Conversation
|
@Lazyartist1 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
|
@Ipramking is attempting to deploy a commit to the blockchainmaxis-8449's projects Team on Vercel. A member of the Team first needs to authorize it. |
✅ Deploy Preview for stellar-signet ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Lazyartist1
force-pushed
the
fix/handle-bindings-archive-restore-186
branch
from
August 30, 2026 16:10
2b3cdce to
09cd458
Compare
…rchive-restore-186
Three problems, the first two of which stopped this from building or working.
1. rpc.Api.isSimulationRestorePreamble does not exist. The SDK's guard is
isSimulationRestore. `pnpm typecheck` failed on it:
lib/profiles.ts(368,15): error TS2551: Property
'isSimulationRestorePreamble' does not exist on type 'typeof Api'.
It was called in three places (profiles.ts, registry.ts,
scripts/keepalive-contract.mjs), each with a hand-rolled
`'restorePreamble' in sim` fallback beside it, so the mistake was masked
rather than surfaced. The SDK guard is stricter in the way that matters —
it also requires the preamble to carry `transactionData`, and a preamble
without that names nothing to restore. Dropped the fallbacks and the
`as any` casts with them.
2. restoreHandleBinding submitted a restore that restores nothing. It built
`Operation.restoreFootprint({})` and never touched `sim.restorePreamble`,
so the transaction carried an empty footprint. The preamble is exactly
where the network reports what to restore: its `transactionData` is the
footprint and `minResourceFee` the cost. The transaction now adopts both
via setSorobanData, and pays BASE_FEE + minResourceFee. Also replaced
`const sdk: any = await import(...)` with a typed destructured import.
3. The archived-detection test used a fixture the RPC never returns — only a
`restorePreamble`, with no top-level `transactionData`. An archived read
is a *successful* simulation (the network answers as if the entry were
live) that additionally carries the preamble, which is why the correct
guard rejected the stub. Fixture corrected, plus an inverse test asserting
a healthy read is never reported as archived.
Also stopped putting a user-facing sentence in the archived profile's `bio`;
the `archived` flag is the signal, and `bio` is a developer's own text.
256/256 web tests pass; typecheck, lint, build and check-docs clean.
Note: the restore path itself is not exercised against a genuinely archived
entry — that needs an entry left untouched past the ~30 day TTL — so it is
verified by construction against the SDK's types, not end to end.
blockchain-maxis
merged commit Sep 2, 2026
da0646e
into
blockchain-maxis:main
10 of 11 checks passed
blockchain-maxis
added a commit
to kaylachi/signet
that referenced
this pull request
Sep 2, 2026
…essage Merge resolution: main reformatted the TROUBLESHOOTING table (prettier, via blockchain-maxis#344), so took main's formatting and reapplied this branch's wording change to the one affected cell. The PR changed the status message and its e2e assertion, but the same false claim was left in four other places, which is the thing issue blockchain-maxis#218 is actually about — the copy asserting the contract is not deployed when it is: - docs/TROUBLESHOOTING.md §6 still said 'the Phase 2 message is intentional' and 'unset → Phase 2 copy'; - docs/DEPLOYMENT.md's verification table said 'UI shows Phase 2'; - README.md said the UI 'shows an honest "Phase 2" message'; - the e2e test was still named '…shows the honest Phase 2 state'. All now describe the real condition: the deployment is not configured against a registry. The genuine roadmap uses of 'Phase 2' (README's 'What's coming next', the docs page) are untouched — those are about project phases, not this error. check-docs and the web build pass. Locally the unconfigured e2e case cannot run — my .env bakes NEXT_PUBLIC_IDENTITY_REGISTRY_ID into the build, so the not-configured path never renders; that is the 'build and shell disagree' case the test's own comment describes, and it skips correctly once the shell env matches. CI builds without the id, so it exercises the real path there.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #186
Summary of Changes
Prevents handle profile 404s caused by Soroban persistent storage entry archival (~30 days of inactivity) by detecting
restorePreamble, providing graceful archival state handling, adding client restoration helpers, and supplying an operator keep-alive sweep tool.Key Changes
Archival Detection & Read Handling:
apps/web/lib/server/registry-read.ts:simulateReadDetailedandresolveHandleDetailedto detect cold storagerestorePreamblein RPC simulation responses.apps/web/lib/profiles.ts:safeChainProfileto return an archived profile state rather thannullwhen an entry is in cold storage, preventing/p/{handle}from returning a 404.On-Chain Restoration Workflow:
apps/web/lib/registry.ts:restoreHandleBinding(handle, walletAddress)helper to simulate, build, and submit aRestoreFootprinttransaction signed by the user's wallet.Operator Tooling & Keep-Alive Sweep:
scripts/keepalive-contract.mjs:Documentation & Runbook:
docs/ARCHIVAL_AND_RESTORATION.md:docs/TROUBLESHOOTING.md:Verification Status
apps/web/lib/server/registry-read.test.tspassing (including live, archived, unbound, and unconfigured checks).node scripts/check-docs.mjspassed cleanly (23 markdown files, 27 env vars, no drift).node scripts/check-contract-errors.mjspassed.