Some responses were coming back completely incorrect, they have been fixed by using EncodableValue() to pass values back to Flutter.
task!.snapshotEvents events were never firing. The storage event listener (onProgress, and onPause) were incorrectly passed to the API handler (e.g. putBytes(), putFile(), etc). This is the correct way to instantiate.
task.pause(), task.cancel(), task.resume() were also broken. The incorrect encoding of values passed back to Flutter stopped the flutter side from having proper values to parse.
The error map was never passed back in the stream event handling so exception were not being thrown correctly when listening to events.
Fixed an issue in Firebase core C++ were AppOptions (equivalent to FirebaseOptions in Flutter side) was creating every property as an empty string. For example, storage bucket option was being passed back to Flutter as an empty string.
snapshot was missing path property causing exception on Flutter side when handling File streaming events.
metadata as a property on snapshot was also missing bucket property.
Tests
Storage windows now has integration tests albeit using a live Firebase project. There are some tests that are skipped which are largely stream handling events, I spent quite a bit of time on this. It works when running the app but fails in a test environment. The good news is most tests are being used.
I updated the putData(), putFile() and putString() tests to also check the content is correct and not gibberish or base64 encoding.
I've found a bug in the C++ SDK, if you try to update metadata on an object that does not exist, it will throw an unauthorized exception rather than an object-not-found exception. I checked native, it is a firebase SDK bug.
Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]).
This will ensure a smooth and quick review process. Updating the pubspec.yaml and changelogs is not required.
[ ] I read the Contributor Guide and followed the process outlined there for submitting PRs.
[ ] My PR includes unit or integration tests for all changed/updated/fixed behaviors (See Contributor Guide).
[ ] All existing and new tests are passing.
[ ] I updated/added relevant documentation (doc comments with ///).
[ ] The analyzer (melos run analyze) does not report any problems on my PR.
Description
Fixes
putData()
is now writing the data as intended.putString()
is now decoding from base64 and base64Url before writing string (previously writing string as base64).putFile()
metadata was not working correctly.putFile()
we have also had to do a hack to pass metadata asnull
on windows, it was throwing exception in pigeon even though it is allowable as a nullable value. Not ideal, but it works.customMetadata
is now returned with the snapshot which fixes: https://github.com/firebase/flutterfire/issues/12711EncodableValue()
to pass values back to Flutter.putBytes()
,putFile()
, etc). This is the correct way to instantiate.task.pause()
,task.cancel()
,task.resume()
were also broken. The incorrect encoding of values passed back to Flutter stopped the flutter side from having proper values to parse.error
map was never passed back in the stream event handling so exception were not being thrown correctly when listening to events.AppOptions
(equivalent toFirebaseOptions
in Flutter side) was creating every property as an empty string. For example, storage bucket option was being passed back to Flutter as an empty string.snapshot
was missingpath
property causing exception on Flutter side when handling File streaming events.metadata
as a property onsnapshot
was also missingbucket
property.Tests
putData()
,putFile()
andputString()
tests to also check the content is correct and not gibberish or base64 encoding.Related Issues
fixes https://github.com/firebase/flutterfire/issues/12743 fixes https://github.com/firebase/flutterfire/issues/12711
Checklist
Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]
). This will ensure a smooth and quick review process. Updating thepubspec.yaml
and changelogs is not required.///
).melos run analyze
) does not report any problems on my PR.Breaking Change
Does your PR require plugin users to manually update their apps to accommodate your change?