Toxee remediation: lifecycle, login use case, bootstrap, coordinator,…#1
Conversation
… lint & tests PR-1 Lifecycle & resource leaks: - HomePage: _progressUpdatesSub, explicit dispose() with all subscriptions/timers, _disposed guard - ContactBuilderOverrideHandle (capture/restore), HomePage uses and restores in _bag - LoginPage: if (!mounted) return before setState in finally - DisposableBag: _disposed guard, add() throws when disposed, dispose() logs exceptions PR-2 Login flow: - LoginUseCase (LoginParams, LoginSuccess, execute), LoginPage delegates and supports DI - Removed in-page SDK/prefs/init, use case handles TIM init and persistence PR-3 Startup: - EchoUIKitApp: theme sync in initState/dispose, removed addPostFrameCallback from build - AppBootstrap + LoggingBootstrap, PrefsBootstrap, AppRuntimeBootstrap, DesktopShellBootstrap - main() slims to ensureInitialized + AppBootstrap.initialize() + switch runApp - _WindowStateListener moved to desktop_shell_bootstrap with logging on catch PR-4 HomePage & runtime: - SessionRuntimeCoordinator (ensureInitialized, disposeRuntime), HomePage uses it - AccountService.teardownCurrentSession calls SessionRuntimeCoordinator.disposeRuntime() - HomePageController, HomePageScope, HomePageView added (structure for future migration) PR-5 Lint & guard: - analysis_options: always_declare_return_types, avoid_print, cancel_subscriptions, etc. - tool/check_complexity.dart (warn-only), .github/workflows/analyze.yml - test/util/disposable_bag_test.dart, placeholder tests for use case/coordinator/contact Made-with: Cursor
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8b3c88b362
ℹ️ 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".
| if (_state == SessionRuntimeState.disposed) { | ||
| AppLogger.warn('[SessionRuntimeCoordinator] ensureInitialized called after dispose, skipping'); | ||
| return; |
There was a problem hiding this comment.
Allow runtime coordinator to reinitialize after teardown
AccountService.teardownCurrentSession() now routes through SessionRuntimeCoordinator.disposeRuntime(), which sets _state to disposed; after that, ensureInitialized() immediately returns for every subsequent login/switch because of this guard, so the runtime (FakeUIKit/platform/call services) is never brought back up in the same app process. This breaks post-logout or account-switch flows that navigate back to HomePage and expect session runtime init to run again.
Useful? React with 👍 / 👎.
| if (isZip) { | ||
| accountData = await AccountExportService.importFullBackup( | ||
| filePath: filePath, | ||
| password: password, | ||
| ); |
There was a problem hiding this comment.
Check account collisions before importing ZIP backups
In the ZIP path, the UI calls importFullBackup() before checking whether the target account/profile already exists, but importFullBackup() performs writes (profile/history/avatars/scoped prefs) as part of import. That means duplicate-account detection (or user cancellation/error afterward) happens too late and can still leave partial or overwritten data on disk, which is a data-integrity regression specific to .zip imports.
Useful? React with 👍 / 👎.
… lint & tests
PR-1 Lifecycle & resource leaks:
PR-2 Login flow:
PR-3 Startup:
PR-4 HomePage & runtime:
PR-5 Lint & guard:
Made-with: Cursor