Skip to content

Migrate pre-Grove Account startup-check SceneStorage state - #100

Open
MonzerMansour wants to merge 1 commit into
SchmiedmayerLab:mainfrom
MonzerMansour:fix/account-startup-check-migration
Open

MonzerMansour wants to merge 1 commit into
SchmiedmayerLab:mainfrom
MonzerMansour:fix/account-startup-check-migration

Conversation

@MonzerMansour

Copy link
Copy Markdown

Closes #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 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
and Contributing Guidelines:

Made with Cursor

…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>
@coderabbitai

coderabbitai Bot commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 1270a0e8-cdf5-47af-aaa6-a7bfc9347b65


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.

Migrate the pre-Grove Account startup-check SceneStorage state

1 participant