Skip to content

feat: lifecycle storage foundation [rn] (1/4)#34

Open
choudlet wants to merge 1 commit into
mainfrom
chrish/sc-36800/rn-lifecycle-pr1-storage
Open

feat: lifecycle storage foundation [rn] (1/4)#34
choudlet wants to merge 1 commit into
mainfrom
chrish/sc-36800/rn-lifecycle-pr1-storage

Conversation

@choudlet

@choudlet choudlet commented Apr 27, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Slice 1 of 4 in the RN lifecycle stack (sc-36800).
  • Adds a dedicated metarouter:lifecycle:* AsyncStorage namespace plus thin async helpers (getLifecycleVersion, getLifecycleBuild, setLifecycleVersionBuild).
  • No behavior changes outside the new module — feature stays inert until slice 3 wires it into MetaRouterAnalyticsClient.

Stack

  1. This PR — storage foundation (~110 LOC)
  2. Lifecycle event emitter + tests
  3. AnalyticsClient wiring + openURL public API + opt-in default
  4. README documentation

Test plan

  • npx jest src/analytics/utils/lifecycleStorage.test.ts — 6 tests cover read, write, missing keys, and storage failures (best-effort swallow)
  • npx tsc --noEmit clean

Adds a dedicated AsyncStorage namespace (`metarouter:lifecycle:*`) for
persisting last-seen `(version, build)`. Lives in its own module so
neither `IdentityManager.reset()` nor `MetaRouterAnalyticsClient.reset()`
can clear install/update history — lifecycle state is device-scope, not
user-scope (parity with iOS `LifecycleStorage` and Android equivalent).

Storage failures are swallowed and treated as 'no prior lifecycle state'
so the caller can safely fall through to fresh-install or upgrade
detection without try/catch noise at every read site.

Slice 1 of 4 in the RN lifecycle stack (sc-36800).
@lucasrc

lucasrc commented Apr 27, 2026

Copy link
Copy Markdown

Code Review - Hermes Agent

Looks Good

No common issues detected.


Reviewed by Hermes Agent

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.

2 participants