-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
fix(storage): omit unserializable properties when hash uploadDataOptions #14151
Conversation
f1a7133
to
126e435
Compare
126e435
to
14a23f7
Compare
15be2b1
to
914d289
Compare
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.
LGTM
packages/storage/src/providers/s3/apis/internal/uploadData/multipart/uploadHandlers.ts
Show resolved
Hide resolved
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.
Is determining if something is serializable or not sufficient to resolve the underlying issue moving forward? It seems to me like the problem was created by something that was serializable and just shouldn't have been included in the calculation of the options hash.
… runtime types" This reverts commit 914d289.
resumableUploadsCache?: KeyValueStorageInterface; | ||
} = {}, | ||
): string => { | ||
const unserializableOptionProperties: string[] = [ |
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.
lets leave a comment maybe to update this as needed
Description of changes
From #13931, we added a internally-injected option
resumableUploadsCache
for public uploadData API. However, the default value of this optionKeyValueStorage
has a reference to theLocalStorage
instance.This causes that the hash value of uploadData options keeps changing, as the
LocalStorage
value keep changing. This fix adds a list of options that should NOT be hashed when calculating the options hash. Any new options will be added options hash by default.Issue #, if available
#14149
Description of how you validated changes
Unit test; Manual integ test
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.