Repository navigation
Rework subscription import worker - #13608
Conversation
|
This should fix most of the issues raised by @Stypox in #13347 (comment) |
|
I am not super happy with the notification being shown before channels are inserted into database but I assume there shouldn't a failure to insert the subscriptions into database in any case. |
Idadelveloper
left a comment
There was a problem hiding this comment.
Not sure if i missed it but is it deliberate that the user is not notified once import begins? Tried importing a csv and for a second i thought i did not work or my phone froze especially as there were so many items in the file. Will be nice if once the user uploads the file for youtube/soundcloud it leaves that import screen and return back to the subscriptions tab while the import happens. Remaining in the import screen plus the fact that there's no notification to tell the user the import is in progress does not do justice for the UX... or let me know what you think.
The UI part is indeed handled poorly overall in general. For example, we have a worker trying to update UI by toast, which in my opinion should be done by a notification instead. I will do another PR for changing UI behavior and would like this one to be focused on fixing bugs. |
Isira-Seneviratne
left a comment
There was a problem hiding this comment.
This looks good to me.
|
Thank you! I tested the APK from CI using the same data as in #13347 (comment). I still got the following after importing a The same happens also with importing a Importing a huge "previously exported" JSON works though (which is one of the big things that wasn't working before), so the memory issues seems fixed indeed. Do you think it would be possible to write some Android tests to ensure we don't introduce regressions again in the future? |
9a367ef to
096ca26
Compare
|
Zip part should be fixed now thanks to @djchittoor's commit. I will take a look at tests this week. |
|
It imports subscriptions, but not the channel groups. Is this expected? |
Signed-off-by: Aayush Gupta <contact@aayush.io>
After subscription import was moved from the Java service to the worker, picked files were classified using only the URI string. Files selected through Android's document picker may use opaque content URIs, so a subscriptions.csv file from Downloads could be treated as application/octet-stream and rejected before parsing. The previous StoredFileHelper path has been restored. The document provider is asked for the type first, with the picked file name used as a fallback. This matches the behavior used before the worker refactor.
The resolver tests cover the octet-stream, missing-type, and unknown-extension fallbacks. The extractor tests confirm that CSV and Takeout zip inputs parse through the YouTube extractor once the content type is resolved. This keeps the regression coverage tied to the parser path that rejected the Downloads import.
Import requests queued by older code can omit the explicit mode field. That path must still be decoded as the previous export format while the new channel URL and input stream modes keep their WorkManager payloads stable. The pure data tests cover those round trips and the invalid mode cases without requiring the worker to be started.
096ca26 to
e47f505
Compare
Was that working before? |
|
I don't know, but that was my expectation while importing. Added commented just in case it is a miss, because I was expecting it to import groups too but it's fine if it was there from the beginning. Thanks. |
Stypox
left a comment
There was a problem hiding this comment.
Thank you! I tested again with the previously mentioned .csv, .json and .zip of 342 subscriptions, and it worked well even under averse network conditions. I did not test whether everything still works well with non-SAF, so someone could test that.
What is it?
Description of the changes in your PR
Fixes the following issue(s)
APK testing
The APK can be found by going to the "Checks" tab below the title. On the left pane, click on "CI", scroll down to "artifacts" and click "app" to download the zip file which contains the debug APK of this PR. You can find more info and a video demonstration on this wiki page.
Due diligence