-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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): md5 calculation for react native #13836
Conversation
hasher.update(content); | ||
} else if (ArrayBuffer.isView(content) || content instanceof ArrayBuffer) { | ||
const blob = new Blob([content]); |
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.
Blob([arrayBuffer]) and Blob([arrayBufferView]) works in web but not RN. This can be removed for both platforms
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.
Removed for both platforms?
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.
Yep, since it's un-necessary code removing it from both web and RN
{ type: 'ArrayBuffer view', content: new Uint8Array() }, | ||
{ type: 'ArrayBuffer', content: new ArrayBuffer(8) }, | ||
{ type: 'Blob', content: new Blob([stringContent]) }, |
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.
Why take this test out?
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.
Just refactored the test. we're testing all 4 data input types in unit tests,
{ type: 'ArrayBuffer view', content: new Uint8Array() }, | ||
{ type: 'ArrayBuffer', content: new ArrayBuffer(8) }, | ||
{ type: 'Blob', content: new Blob([stringContent]) }, |
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.
same here
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.
replied on this comment
hasher.update(content); | ||
} else if (ArrayBuffer.isView(content) || content instanceof ArrayBuffer) { | ||
const blob = new Blob([content]); |
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.
Removed for both platforms?
hasher.update(content); | ||
} else if (ArrayBuffer.isView(content) || content instanceof ArrayBuffer) { | ||
const blob = new Blob([content]); |
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.
IF this works for web then why remove it?
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.
Yep, since it's un-necessary code at this point removing it from both web and RN
Description of changes
upload
with data as ArrayBuffer or ArrayBufferView when objectLock is enabled in react native givescreating blobs from 'arraybuffer' and 'arraybufferview' are not supported
error in react native.PENDING: updating e2e tests for web and RN. Can come in separate PR
repro steps:
Description of how you validated changes
Enabled object lock for bucket manually in backend. upload data of types Blob, string, ArrayBuffer and ArrayBufferView in both browser and react native to test if object is successfully uploaded
Tested code snippets below in browser and RN
Checklist
yarn test
passesChecklist for repo maintainers
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.