SDK 4.x DemoApp - #194
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3c89190b7f
ℹ️ 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".
| // checking. Stopgap until flutter/flutter#181033 lands; the engine always calls | ||
| // didInitializeImplicitFlutterEngine on the main thread. | ||
| @objc class AppDelegate: FlutterAppDelegate, @preconcurrency FlutterImplicitEngineDelegate { | ||
| @objc class AppDelegate: FlutterAppDelegate, FlutterImplicitEngineDelegate { |
There was a problem hiding this comment.
Restore the preconcurrency protocol conformance
The old example kept @preconcurrency on FlutterImplicitEngineDelegate because current Flutter engines are not actor-annotated there; dropping it reintroduces the Swift 6/Xcode 26 isolation failure before the iOS example can build. In the Xcode 26 environment declared for this repo, keep the protocol conformance as @preconcurrency FlutterImplicitEngineDelegate so didInitializeImplicitFlutterEngine can satisfy the requirement.
Useful? React with 👍 / 👎.
| userId = trimmed; | ||
| notifyListeners(); | ||
|
|
||
| await reloadProfile(); |
There was a problem hiding this comment.
Refresh the flow after changing users
When a user logs in, the SDK identity changes but the controller keeps using the flow fetched during initialization for the previous anonymous/user profile. For placements whose audience or Flow differs by customer user id, the premium recipes will keep presenting the stale Flow until the app restarts; reload or invalidate flow after identify (and similarly after logout) before presenting paywalls.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c288acc52f
ℹ️ 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".
| await _adapty.identify(trimmed); | ||
| await _userManager.login(trimmed); | ||
| userId = trimmed; |
There was a problem hiding this comment.
Clear identity state before switching users
When this identity switch succeeds but either subsequent refresh fails, for example offline or a server error from getProfile/getFlow, profile and flow still contain the previous identity's objects because the refresh helpers only overwrite on success. That leaves isPremiumUser and premium paywall presentation using the old user's state after login, and the same pattern exists in logout; clear those identity-scoped fields before switching or before refreshing. The fresh evidence is that the reload calls are present now, but their failure path never invalidates the old values.
Useful? React with 👍 / 👎.
|
The new Recipes app is a clear improvement over the old example — the structure is much easier to follow. A few things to resolve before it goes in. Blocking1. Identity-scoped state survives a failed refresh
So when Should fix2. The example silently left Swift 6 language modeThe project the PR deletes sets I checked both halves of this on Xcode 26.5 / Flutter 3.41.8. The branch builds as-is: Flipping only So the Codex P1 from Jul 9 is not accurate as written — nothing is broken for the example as configured — but the regression underneath it is real and one level up: the example used to compile under Swift 6, deliberately (the 3.
|
|
Codex Review: Didn't find any major issues. Can't wait for the next one! 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". |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e967c56f34
ℹ️ 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".
| return; | ||
| } | ||
|
|
||
| configurationInvalid = !AppConstants.debugAssertValidConfiguration(); |
There was a problem hiding this comment.
Check placeholders before invoking the debug assertion
When the repository's placeholder configuration is used with the README's default debug flutter run, debugAssertValidConfiguration() throws before configurationInvalid is assigned or this early-return can run. Because initState discards the initialize() future, startup reports an unhandled asynchronous Flutter error even though the app has a dedicated configuration fallback screen; check hasValidConfiguration without asserting on this expected state.
Useful? React with 👍 / 👎.
| } catch (error) { | ||
| _setErrorIfOwned(errorOperation, _messageFor(error)); |
There was a problem hiding this comment.
Provide a retry path after initialization failures
When currentUserId, isActivated, or activate fails transiently, this catch leaves isInitialized false and only publishes an error. The recipes screen offers only banner dismissal, while profile actions are disabled through canUseSdk, and nothing calls initialize() again, so the demo remains unusable until the process is restarted; expose an initialization retry or retry automatically.
Useful? React with 👍 / 👎.
No description provided.