Repository navigation
Conversation
|
AI review done for Quality: The change addresses the original permanent rejected-future and partially initialized worker issues, and the focused tests pass. The remaining startup and cache interactions create medium-risk account and recovery failures that need fixes before merge.
|
There was a problem hiding this comment.
AI review · GPT + Grok · dad6b9d
Request changes. Focused tests passed with +23 tests, but code inspection confirms that a transient package-info failure is cached permanently, can leave the message worker partially initialized, and traps mobile phone login on its loading state. No desktop integration test was run in this checkout.
…solate, and mobile login
| } catch (error, stack) { | ||
| e('generate user agent failed. $error $stack'); | ||
| return null; | ||
| rethrow; |
There was a problem hiding this comment.
When package metadata is unavailable during checkSignalKeys(), the request fails locally while building the User-Agent. AccountServer.initServer() treats that non-API error as a startup failure and calls signOutAndClear(), which can then retry /logout after _getUserAgent() has reset its failed future. A transient metadata failure can therefore revoke a valid session and clear its local keys. Keep metadata initialization failures from entering the sign-out path, or distinguish this local prerequisite failure before revoking the session.
| } catch (error, stacktrace) { | ||
| e('message worker isolate init failed: $error, stacktrace: $stacktrace'); | ||
| await runner.dispose(); | ||
| Isolate.exit(); |
There was a problem hiding this comment.
This exits the worker after an initialization failure, but AccountServer retains the existing _isolateChannel and only publishes ConnectedState.disconnected when the isolate exits. A later Retry calls reconnectBlaze(), which sends reconnectBlaze to that dead channel and never starts a new worker, so message processing remains offline after package info recovers. Clear the dead channel and respawn the worker on exit, or make the retry path restart the worker.
| return await PackageInfo.fromPlatform(); | ||
| } catch (error, stack) { | ||
| e('get package info failed. $error $stack'); | ||
| final info = await PackageInfo.fromPlatform(); |
There was a problem hiding this comment.
PackageInfo.fromPlatform() caches the PackageInfo object before this validation runs. If the plugin returns an empty version once, that invalid object remains in its static _fromPlatform cache, so the login Retry and later calls receive the same empty version without querying the platform again. Read the platform data through a path that validates it before caching, or otherwise invalidate and retry the package-info cache when the version is empty.
Summary
APP_VERSION/APP_BUILD_NUMBER--dart-defineplumbing inlib/utils/system/package_info.dart, CI workflows, anddist/test_update_macos.sh. Windows builds already embedpubspec.yaml(and--build-name/--build-number) intoRunner.rc'sVS_VERSION_INFO, whichpackage_info_plusreads via Win32 FFI.nullUser-Agent so requests are aborted locally rather than risking IP blocks from an outdated UA.message_worker_isolate.dartviaui.DartPluginRegistrant.ensureInitialized()sopackage_info_plusworks on Windows/Linux worker isolates.integration_test/package_info_test.dartcovering both main and worker isolates.Evidence
--dart-definealways reported the hardcoded fallback (7.0.1+0), andpackage_info_test.dart'sIsolate.runtest loggedBad state: BackgroundIsolateBinaryMessengerand fell back to the hardcoded version.flutter analyzeon all touched Dart files:No issues found!flutter test test/utils/package_info_test.dart:15/15 All tests passed!flutter test integration_test/package_info_test.dart -d windows, no--dart-define):PASSappName=mixin, packageName=mixin_desktop, version=7.1.1, buildNumber=632appName=mixin, packageName=mixin_desktop, version=7.1.1, buildNumber=632Merge Danger
Door: two-way
Blast Radius: medium
If
PackageInfo.fromPlatform()ever fails or returns an empty version on any platform/isolate,generateUserAgent()now throws instead of falling back to a hardcoded version ornull, intentionally blocking network requests rather than sending an invalid/outdatedUser-Agent.