fix(storage,windows): dispatch task events on the platform thread - #18667
fix(storage,windows): dispatch task events on the platform thread#18667SelaseKay wants to merge 3 commits into
Conversation
Sequential putData tests never overlap progress callbacks, so they miss the native access violation in TaskStateListener::OnProgress.
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 馃憤 and 馃憥 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. |
Concurrent putData crashed Windows because progress callbacks called EventSink::Success from an SDK worker thread and the stream handler never owned the sink.
Description
Windows
putDataprogress was posted from a Firebase C++ SDK worker thread. Flutter requires platform-channel messages on the platform thread; concurrent uploads then native-crashed the process.This PR:
EventSink(the handlers stored aunique_ptr&&member and never took ownership)TaskStateListener/ completion events onto the platform thread via anHWND_MESSAGEdispatcher (same approach as Firestore Windows)StorageReferencethat started each upload alive until the SDK Future completesThe concurrent
putDatae2e (3脳13 overlapping uploads + readback) is expected to go green on Windows after this native change. On the tests-only commit, CI logged the off-threadtaskEventwarning and the VM service disappeared as soon as the concurrent test started.Related Issues
Test plan
e2e-storage/windows) passesuploads many small files concurrently and reads them backsent a message from native to Flutter on a non-platform threadlogs onplugins.flutter.io/firebase_storage/taskEventChecklist
///).melos run analyze) does not report any problems on my PR.Breaking Change