Repository navigation
Conversation
GenericModelManager observed .mlkitModelDownloadDidSucceed/.mlkitModelDownloadDidFail with `object: model`. ML Kit posts both notifications with its own manager/downloader as the sender and the model only in userInfo[ModelDownloadUserInfoKey.remoteModel], so the observers never fired and ModelManager.downloadModel() never returned on iOS for a model that was not yet on the device. Observe with `object: nil` and match the model from userInfo, as shown in the ML Kit iOS documentation. Regression from the Objective-C to Swift migration (flutter-ml#844). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fbernaly
approved these changes
Oct 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #906
GenericModelManagerobserved.mlkitModelDownloadDidSucceed/.mlkitModelDownloadDidFailwithobject: model. ML Kit posts both notifications with its own manager/downloader as the sender and passes the model only inuserInfo[ModelDownloadUserInfoKey.remoteModel], so the observers never fired andModelManager.downloadModel()never returned on iOS when a model actually had to be downloaded.This change observes with
object: niland matches the model fromuserInfo, as shown in the ML Kit iOS documentation ("Explicitly manage translation models").RemoteModelimplementsisEqual:, so==also matches another instance of the same model. The result sent to Dart is unchanged (success/error).Regression from the Objective-C → Swift migration (#844). The Objective-C implementation observed with
object:nil.Verified
git apply --checkondevelop(1083593)swiftc -typecheck(Swift 5, arm64-apple-ios15.5, iPhoneOS SDK) against the realFlutter.frameworkandMLKitCommon.framework: no errors or warnings, before and afterNot verified
🤖 Generated with Claude Code