contrib: add migration checklist for breaking session schema changes - #344
Merged
davedumto merged 1 commit intoAug 31, 2026
Conversation
Self-contained reference for issue Vellar-Wallet#282 under contrib/examples. There is no standard process for safely rolling out a breaking change to the stored WalletSession schema across consumer versions. Sessions are persisted by the consumer's app, and restore() is deliberately fail-soft, so an unmigrated breaking change silently signs every existing user out on their next app load with no error surfaced anywhere. CHECKLIST.md covers backward compatibility, migration helper usage, the tests a migration PR must carry, and rollout, and asks migration PRs to reference it in their description. It is backed by a runnable implementation of a worked example, replacing a flat lastActiveAt field with a structured activity object, so the guidance is demonstrably correct rather than only asserted. Includes 18 tests exercising every item in checklist sections 1 to 3: both shapes accepted, invalid data still rejected, migration on read, idempotency, purity, and the fallback for the newly required field.
|
@arandomogg is attempting to deploy a commit to the david's projects Team on Vercel. A member of the Team first needs to authorize it. |
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.
Summary
Adds a self-contained reference under
contrib/examples/issue-282-session-schema-migration-checklist/providing a standard checklist for safely rolling out a breaking change to the stored session schema across consumer versions.Scoped entirely to
contrib/per CONTRIBUTING.md andcontrib/README.md.Why it's needed
WalletSessionis persisted by the consumer's app (localStorage, or their ownSessionStorageAdapter), not by the SDK's own process. A user can carry a session written by an older SDK for months before their app upgrades.restore()insrc/session.tsis deliberately fail-soft — unreadable storage means "disconnected", never a crash — so an unmigrated breaking schema change silently signs every existing user out on their next app load, all at once, with no error surfaced anywhere.Files
CHECKLIST.mdsession-schema-migration-checklist.tssession-schema-migration-checklist.test.tsREADME.mdThe checklist covers
Worked example
Replacing the flat
lastActiveAt: stringwith a structuredactivity: { lastActiveAt, lastActiveNetwork }. The guard accepts both shapes, a pure and idempotentmigrateSessionupgrades old data on read with a defined fallback (the session's ownnetwork) for the field that didn't exist before, and invalid data still returnsnull.Requirements checklist
CHECKLIST.mdandREADME.md)contrib/, since this PR is scoped there)Test plan
18 tests, all passing.
closes #282