Repository navigation
fix(native): one lifecycle for the stored items on every platform - #687
Conversation
What a reset to the packaged bundle and a binary upgrade delete besides the state fields differed per platform: a binary upgrade cleared the old versions' info, the first-load marker and the response cache on Android only, and only Android dropped the round breadcrumb (on both events). scripts/contract.ts storedItems now lists every persisted item next to the state fields with the events that delete it, and the generator emits each platform's lists (VersionScopedKeys.java, RCTPushyState.mm, UpdateContext.ts), which the reset and upgrade paths use. Behaviour now, on every platform: both events delete the version info, the first-load marker and the response cache (reset also the iOS package-updated marker); the uuid, the native config, the round breadcrumb and the bundle hash cache survive both. No physical key changes: nothing on disk is migrated. JS normalizes the getConstants values the platforms report differently when absent (isFirstTime to a boolean, rolledBackVersion to ''). Tests: the iOS purge-restore harness gains binary_upgrade_clears_version_keys (fails without the new upgrade clearing), a Harmony test drives UpdateContext.removeKeys with the generated lists, VersionScopedKeysTest covers both events. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
This is the first step of the state_schema item from the architecture review. Reset and binary upgrade now delete the same stored items on every platform. Nothing on disk changes format.
Before
Besides the state fields, what a reset to the packaged bundle and a binary upgrade deleted differed per platform:
hash_*info, the first-load marker and the response cache.Now
scripts/contract.tsstoredItemslists every persisted item and the events that delete it. The generator emits each platform's lists inVersionScopedKeys.java,RCTPushyState.mmandUpdateContext.ts, and the reset and upgrade paths read those lists.getConstantsvalues that the platforms report differently when absent:isFirstTimebecomes a boolean.rolledBackVersionbecomes''.Tests
binary_upgrade_clears_version_keys. It fails without the new upgrade clearing.harmonyStateLifecycle.test.tsdrivesUpdateContext.removeKeyswith the generated lists.VersionScopedKeysTestcovers both events.bun lintpasses (43 generated regions are up to date) andbun testpasses (464 tests).🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need.Summary by CodeRabbit