Migrate pre-Grove Account startup-check SceneStorage state - #100
Open
MonzerMansour wants to merge 1 commit into
Open
MonzerMansour wants to merge 1 commit into
MonzerMansour wants to merge 1 commit into
Conversation
…yerLab#59) ### ♻️ Current situation & Problem In `VerifyRequiredAccountDetailsModifier.swift`, the rename to Grove changed the `@SceneStorage` key from `"edu.stanford.spezi-account.startup-account-check"` to `"org.grovealliance.account.startupAccountCheck"`. Because `@SceneStorage` persists across app launches and upgrades on the device, upgrading an app from Spezi to Grove causes the completion marker to be lost, needlessly triggering the startup account check sheet again for existing users. Additionally, previous verification state was tracked purely via a boolean flag without scoping to the authenticated account identifier, creating a potential condition where switching accounts could allow stale state to suppress a required follow-up. ### ⚙️ Release Notes - Added `LegacySceneStorageKey.accountStartupCheck` (`"edu.stanford.spezi-account.startup-account-check"`) in `GroveLegacyIdentifiers` to preserve completed startup check state across app upgrades. - Encapsulated startup check evaluation and legacy migration in `AccountStartupCheckState`. On upgrade, completed legacy state is migrated to Grove scene storage, reported via `LegacyIdentifierReport`, and cleared from legacy storage. - Scoped verification to `verifiedAccountId` so account switches, logouts, and late logins correctly prompt for missing required keys without stale state suppression. - Pinned `LegacySceneStorageKey.accountStartupCheck` in `LegacyIdentifierInventoryTests` (inventory count 28). - Documented automatic migration in `Migrating to Grove.md` and transitional key removal timeline. ### 📚 Documentation - Updated `Migrating to Grove.md` automatic migration table. - Added DocC documentation on `LegacySceneStorageKey.accountStartupCheck` noting removal timeline (no earlier than one minor release after 0.3.0). ### ✅ Testing - Added unit test suite `AccountStartupCheckMigrationTests` verifying key constant spelling, migration of completed legacy state, rejection of incomplete legacy state, fresh installs, account changes, switching back, and startup timeouts with late login. - Verified all unit and UI tests pass on iOS 26 simulator: `GroveAccountTests`, `GroveFoundationTests` (`LegacyIdentifierInventoryTests`), and UI test `testVerifyRequiredAccountDetailsModifier`. - Verified UI test project consistency and documentation target consistency scripts. ### Code of Conduct & Contributing Guidelines By creating and submitting this pull request, you agree to follow our [Code of Conduct](https://github.com/SchmiedmayerLab/.github/blob/main/CODE_OF_CONDUCT.md) and [Contributing Guidelines](https://github.com/SchmiedmayerLab/.github/blob/main/CONTRIBUTING.md): - [x] I agree to follow the [Code of Conduct](https://github.com/SchmiedmayerLab/.github/blob/main/CODE_OF_CONDUCT.md) and [Contributing Guidelines](https://github.com/SchmiedmayerLab/.github/blob/main/CONTRIBUTING.md). Co-authored-by: Cursor <cursoragent@cursor.com>
Contributor
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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 #59
♻️ Current situation & Problem
In
VerifyRequiredAccountDetailsModifier.swift, the rename to Grove changed the@SceneStoragekey from"edu.stanford.spezi-account.startup-account-check"to"org.grovealliance.account.startupAccountCheck".Because
@SceneStoragepersists across app launches and upgrades on the device, upgrading an app from Spezi to Grove causes the completion marker to be lost, needlessly triggering the startup account check sheet again for existing users. Additionally, previous verification state was tracked purely via a boolean flag without scoping to the authenticated account identifier, creating a condition where switching accounts could allow stale state to suppress a required follow-up.⚙️ Release Notes
LegacySceneStorageKey.accountStartupCheck("edu.stanford.spezi-account.startup-account-check") inGroveLegacyIdentifiersto preserve completed startup check state across app upgrades.AccountStartupCheckState. On upgrade, completed legacy state is migrated to Grove scene storage, reported viaLegacyIdentifierReport, and cleared from legacy storage.verifiedAccountIdso account switches, logouts, and late logins correctly prompt for missing required keys without stale state suppression.LegacySceneStorageKey.accountStartupCheckinLegacyIdentifierInventoryTests(inventory count 28).Migrating to Grove.mdand transitional key removal timeline.📚 Documentation
Migrating to Grove.mdautomatic migration table.LegacySceneStorageKey.accountStartupChecknoting removal timeline (no earlier than one minor release after 0.3.0).✅ Testing
AccountStartupCheckMigrationTestsverifying key constant spelling, migration of completed legacy state, rejection of incomplete legacy state, fresh installs, account changes, switching back, and startup timeouts with late login.GroveAccountTests,GroveFoundationTests(LegacyIdentifierInventoryTests), and UI testtestVerifyRequiredAccountDetailsModifier.Code of Conduct & Contributing Guidelines
By creating and submitting this pull request, you agree to follow our
Code of Conduct
and Contributing Guidelines:
and Contributing Guidelines.
Made with Cursor