Bug 1856431 Comment 4 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

So there're two bugs here?

1. Upload multiple large files cause phone freeze or black screen for a few time 
2. Unable to select file with "#" (pound sign/ hash mark) in filename

Am i understand correctly?

For 
1. There's heavy io in selecting multiple files because it will copy file to a temp uploads folder under app's cache folder one by one.  Iteration [Code](https://searchfox.org/mozilla-mobile/source/firefox-android/android-components/components/browser/engine-gecko/src/main/java/mozilla/components/browser/engine/gecko/prompt/GeckoPromptDelegate.kt#455-456)  , and the copy [code](https://searchfox.org/mozilla-mobile/source/firefox-android/android-components/components/browser/engine-gecko/src/main/java/mozilla/components/browser/engine/gecko/prompt/GeckoPromptDelegate.kt#876-880) . There're some solutions: 1. do it in parallel  2. don't do it in IO thread.

2. I suggest to open a new ticket to trace this bug better. The problem is [here](https://searchfox.org/mozilla-mobile/source/firefox-android/android-components/components/browser/engine-gecko/src/main/java/mozilla/components/browser/engine/gecko/prompt/GeckoPromptDelegate.kt#883)  , "#" in the file scheme is treated as a "fragment" just like normal http urls. It will be ignored when [getPath](https://searchfox.org/mozilla-central/source/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoSession.java#6177-6178)  is called.  The solution: Escape the file scheme : `return Uri.parse("file:///${Uri.encode(temporalFile.absolutePath)}")`
So there're two bugs here?

1. Upload multiple large files cause phone freeze or black screen for a few time 
2. Unable to select file with "#" (pound sign/ hash mark) in filename

Am i understand correctly?

For 
1. There's heavy IO in selecting file (especially in selecting multiple/large files) because it will copy file to a temp uploads folder under app's cache folder one by one.  Iteration [Code](https://searchfox.org/mozilla-mobile/source/firefox-android/android-components/components/browser/engine-gecko/src/main/java/mozilla/components/browser/engine/gecko/prompt/GeckoPromptDelegate.kt#455-456)  , and the copy [code](https://searchfox.org/mozilla-mobile/source/firefox-android/android-components/components/browser/engine-gecko/src/main/java/mozilla/components/browser/engine/gecko/prompt/GeckoPromptDelegate.kt#876-880) . There're some solutions: 1. do it in parallel  2. don't do it in IO thread.

2. I suggest to open a new ticket to trace this bug better. The problem is [here](https://searchfox.org/mozilla-mobile/source/firefox-android/android-components/components/browser/engine-gecko/src/main/java/mozilla/components/browser/engine/gecko/prompt/GeckoPromptDelegate.kt#883)  , "#" in the file scheme is treated as a "fragment" just like normal http urls. It will be ignored when [getPath](https://searchfox.org/mozilla-central/source/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoSession.java#6177-6178)  is called.  The solution: Escape the file scheme : `return Uri.parse("file:///${Uri.encode(temporalFile.absolutePath)}")`

Back to Bug 1856431 Comment 4