Repository navigation
feat(device-utils): add synchronous first-launch tracking API - #331
Conversation
There was a problem hiding this comment.
Devin Review found 2 potential issues.
3 flags not posted on this PR by your GitHub settings — view them in Devin Review. (Configure)
|
@codex review |
|
@codex security review |
|
Cursor review failed. Remote error: |
|
Skipping Bugbot: Bugbot is disabled for this repository. Visit the Bugbot dashboard to update your settings. |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6c4fed9d52
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Codex Review: Didn't find any major issues. Keep them coming! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
…rst-launch # Conflicts: # native-modules/react-native-device-utils/ios/ReactNativeDeviceUtils.swift
…t activation contract
Summary
Adds synchronous first-launch tracking to
@onekeyfe/react-native-device-utilsacross iOS, Android, and shared Web/Desktop/Extension (@onekeyfe/react-native-device-utils/first-launch).Design
hasLaunched,highestAppVersion,highestBundleVersion) in a single JSON file on native (onekey-device-utils-first-launch.json) and a singlelocalStoragekey on web (onekey:device-utils:first-launch). Storage size is constant and requires no cleanup API.read disk → freeze current-launch booleans in memory → advance persisted fieldspass. Subsequent getter calls within the same process/document read only from memory and stay consistent acrossmainandbgruntimes.falseand preserves the higher recorded version.app-modules.@objc(OneKeyDeviceUtilsFirstLaunch)singleton (hasPersistedState()+initializeWithOptions(_ options: NSDictionary?)) callable dynamically viaNSClassFromString+performinAppDelegatewithout importing Nitro C++ headers.DeviceUtilsFirstLaunchsingleton (hasPersistedState(context)+initialize(context, isLegacyInstall = { ... }, legacyAppVersion = { ... })) forApplication.onCreate(), with lazyNitroModules.applicationContextfallback if uninitialized.initFirstLaunch({ appVersion, bundleVersion, isLegacyInstall, legacyAppVersion })plus zero-arg synchronous getters (isFirstLaunch(),isFirstLaunchForCurrentAppVersion(),isFirstLaunchForCurrentBundle()).Verification
yarn prepare(Nitrogen codegen + ESM + TypeScript declarations)yarn typecheckyarn test(5/5 Jest tests passing)node tests/in-memory-store.cjs --swift(passed)node tests/in-memory-store.cjs --kotlin(passed)