-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(storage, windows): putFile(), putString(), putData() & Task streaming event fixes #12723
Merged
Conversation
This file contains 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
1 task
10 tasks
russellwheatley
changed the title
fix(storage, windows): putString & putData API fixes
fix(storage, windows): putFile(), putString(), putData() & Task streaming event fixes
May 3, 2024
1 task
Lyokone
reviewed
May 10, 2024
Comment on lines
+263
to
+264
pigeonSettableMetadata = | ||
MethodChannelFirebaseStorage.getPigeonSettableMetaData(metadata); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, probably an issue in Pigeon, but the workaround looks OK
Lyokone
approved these changes
May 10, 2024
TarekkMA
approved these changes
May 10, 2024
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.
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: [FIREBASE_STORAGE]: Wrong json key for customMetadata #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 #12743
fixes #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 the
pubspec.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?