Skip to content
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

content picker not loaded on ubuntu touch #1279

Open
LiohMoeller opened this issue Oct 1, 2024 · 14 comments
Open

content picker not loaded on ubuntu touch #1279

LiohMoeller opened this issue Oct 1, 2024 · 14 comments
Assignees
Milestone

Comments

@LiohMoeller
Copy link

On Ubuntu Touch it is not possible to add a zim file, as the content picker does not show up on a click on the 'Load ZIM' or 'Select Folder' Button.

@kelson42
Copy link
Collaborator

kelson42 commented Oct 3, 2024

@Jaifroid Can we still support Ubuntu Touch devices properly?

@Jaifroid
Copy link
Member

Jaifroid commented Oct 3, 2024

@LiohMoeller @kelson42 The problem is that I don't have an Ubuntu Touch device to test on. I've no idea why the API has broken. I wonder if it's been restricted recently? We used to have someone willing to test, and we'd send them a package before release, they'd test it and also diagnose any issues. For the last several releases, we've been releasing blind for this platform. I'm not sure what I could do about it unless someone with a device were willing to take a look at the code and debug, or at least point me in the right direction. Possibly the File System Access API appears to be supported but isn't actually, and the fallback to the old File Picker isn't working.

@kelson42
Copy link
Collaborator

kelson42 commented Oct 3, 2024

@LiohMoeller Are you able to test on a device and help us a bit with the root cause analysis?

@LiohMoeller
Copy link
Author

I can just send/donate you a device for development, if that would help.

@Jaifroid
Copy link
Member

Jaifroid commented Oct 3, 2024

@LiohMoeller That's very kind, but let me see if there's a reliable simulator I could use first, as I think testing on real hardware would be a bit of a last resort (testing time is already quite onerous). I'll come back to you once I've done some research on this.

@Jaifroid
Copy link
Member

Jaifroid commented Oct 5, 2024

So it seems there is this Ubuntu Touch development kit: https://github.com/ubports/ubports-pdk . I'll see if I can get that to run in order to reproduce the issue.

@AyushSahoo19
Copy link

Hi team,

Before proceeding, I wanted to ask if the team has already tested the content picker issue using the Ubports PDK to simulate the environment?

Since I don’t have access to an Ubuntu Touch device, my plan is to start by setting up this PDK to simulate the environment. This should help me:

  1. Replicate the Issue: I’ll focus on simulating the API behavior and how the content picker interacts with the system.
  2. Test Fallbacks: I’ll check whether the fallback to the old File Picker is functioning properly, especially if the File System Access API is unsupported or restricted.
    If I’m unable to reproduce the issue or need further testing on a real device, would it be possible to collaborate with someone who has access to an actual Ubuntu Touch device? Alternatively, do you have any recommendations for other reliable emulators or testing environments beyond the PDK?

Once I have the PDK set up, I’ll begin debugging the content picker and share my findings. Let me know if you have any specific areas in the codebase you think I should focus on, or any additional guidance for testing.

@Jaifroid
Copy link
Member

Thanks, no we haven't tried replicating the issue yet, so it would be great if you could confirm the bug in the simulator.

The fallback to the standard HTML5 file picker happens if no support for the File System Access API or the webkitdirectory property is found. If either of those are found, then the HTML5 file picker gets hidden. My suspicion is that the APIs appear to be supported, but actually aren't on Ubuntu Touch.

@Jaifroid Jaifroid assigned AyushSahoo19 and unassigned Jaifroid Oct 20, 2024
@Jaifroid Jaifroid added this to the v4.2 milestone Oct 20, 2024
@Jaifroid
Copy link
Member

Jaifroid commented Oct 20, 2024

Also, the fact that there is a "Select folder" button strongly suggests my hypothesis is true. One of these APIs is being detected, but something is breaking. If neither of those APIs were detected, then the system would show the HTMl5 file picker only, and no "Select folder".

@AyushSahoo19
Copy link

Thanks for the details! Could you point me to the specific file or section of the codebase where the content picker’s behavior and fallback mechanisms are handled? This will help me focus on the right part while testing the bug on the Ubuntu Touch emulator. Let me know, and I’ll dive in!

@Jaifroid
Copy link
Member

Yes of course, just search for openLocalFiles in your code editor, and you should find the picker in index.html and app.js (where the initial logic is handled). There is also abstractFilesystemAccess.js which deals with the logic for the File System Access API, webkitdirectory and a few other things.

@AyushSahoo19
Copy link

Before I start debugging the content picker issue, could you let me know which version of Ubuntu (or Ubuntu Touch) I should focus on testing this for? This will help ensure I'm replicating the correct environment.

@Jaifroid
Copy link
Member

@AyushSahoo19 The bug report was from @LiohMoeller , but I'm assuming this is the latest Ubuntu Touch, because we never had this issue on previous versions of the app (at least until a couple of years ago -- no reports of anything till now). I'm assuming something broke recently (but it could be our end of course).

@AyushSahoo19
Copy link

Ok, I’ll proceed with testing the issue on the recent version of Ubuntu Touch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants