-
Notifications
You must be signed in to change notification settings - Fork 3k
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
update document-picker package to support the file protocol #31499
Conversation
src/libs/fileDownload/FileUtils.js
Outdated
@@ -181,7 +182,7 @@ const readFileAsync = (path, fileName, onSuccess, onFailure = () => {}) => | |||
return res.blob(); | |||
}) | |||
.then((blob) => { | |||
const file = new File([blob], cleanFileName(fileName), {type: blob.type}); | |||
const file = new File([blob], cleanFileName(fileName), {type: blob.type || type}); |
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.
What's this change for? blob doesn't return type in updated version?
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.
I tested and confirmed that type isn't returned in old version as well.
So what exactly does this change fix?
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.
For only the files which does have Space
in their name, as you told upload failing for files which does have space init, after some digging type
is the issue for the files which does have the space.
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! But I said it's out of scope as it already happens on main and has different root cause.
Let's just fix crash 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.
oh, ok then. Fine. Will update the code to just have the fix.
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.
update version to latest (9.0.1)
@situchan Updated the code to according to your changes. Please check! |
@b4s36t4 performance tests failing. Please pull main |
Still failing. I don't see any other recent PRs failing that test. |
I'm checking, but I don't see any change in my that's causing the issue. |
@situchan can you check if these tests are working fine on local in |
The error is coming from |
@situchan Fixed. |
@b4s36t4 please add one more test condition - File name should not have space when choosing from document picker |
Reviewer Checklist
Screenshots/VideosThe change doesn't affect non-native platforms (web/desktop/mWeb) Android: Nativeandroid.movAndroid: mWeb ChromeiOS: Nativeios.moviOS: mWeb SafariMacOS: Chrome / SafariMacOS: Desktop |
@marcochavezf I think we should create new GH to fix file name with space issue (#29788 (comment)) |
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.
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.
Thanks guys, LGTM
Ah for this issue ^, what's the exact problem? I tried to upload for scan a file with a space in the name but I didn't have the error: |
That only happens on android. |
With android, if the filename have a space in the name, it's not returning the type of the file which we're trying to get using Tested and it's working fine as well. |
@situchan @marcochavezf Updated the test condition. |
@b4s36t4 ah sorry which test condition? |
#31499 (comment) for QA team to test properly as it will fail with spaced name on android |
Snyk checks are failing, asking how to proceed here |
It's known - https://expensify.slack.com/archives/C01GTK53T8Q/p1700498232891239 |
Ok, given that we're just updating a package library to fix a bug it should be fine, thanks guys! |
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Deployed to production by https://github.com/mountiny in version: 1.4.6-2 🚀
|
Details
Updates the
react-native-document-picker
to solve the issue with Android file download local files.Fixed Issues
$ #29788
PROPOSAL: #29788 (comment)
Tests
Important
Be on Low network if possible
File name should not have space when choosing from document picker
Offline tests
Same as above.
QA Steps
Same as above
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
android.mp4
Android: mWeb Chrome
ios.mp4
iOS: Native
ios.mp4
iOS: mWeb Safari
safari.mp4
MacOS: Chrome / Safari
web.mp4
MacOS: Desktop
desktop.mp4