thetwom / toc2

Metronome app
GNU General Public License v3.0
160 stars 23 forks source link

Loading issue via app choice #52

Closed brilnius closed 2 years ago

brilnius commented 2 years ago

Hello. A small issue I had when loading a set of tempi/patterns ("scenes" is the English term). As I had several apps that can handle the "choose file" action, I first had a "toaster" at the bottom of the screen asking which one I want to use. I chose one, and the chosen app appeared: I found and selected a file to load and then... nothing happened (I'm back in the Metronome app, in the list of scenes). I made several tries, with different apps and different files, but the result was always the same.

So I decided to uninstall all the concerned apps but one, just keeping my preferred one. Just to try. In this case (when there is only one app handling the "choose file" action), everything is ok: no toaster for choosing an app, and after selecting a file the Metronome app asks if I want to append or replace, etc.

So I made another test: I reinstalled one of the apps I had just removed. First try when choosing a file: same thing (the "toaster" to choose an app, and at the end I'm back in Metronome but nothing happened). But this time on the "toaster" when choosing the app I clicked on the button saying "always use this app". Next try when choosing a file was ok (no "toaster").

So my conclusion is: when we go through the "toaster" step for choosing an app (for selecting the file to load), then the loading fails.

I use Metronome v4.5.0 on Android 8.0.0.

Tell me if I can provide more information for reproducing the issue.

thetwom commented 2 years ago

Hi, thanks for the thorough investigation. This makes finding the cause much easier.

I already heard of such kind of a problem and I wonder if this is the same issue. Strangely enough, this issue appeared as soon as MaterialFiles was installed. After removing it everything worked fine. So, my first question would be if you accidentally have MaterialFiles installed, and if yes, if you could try deinstalling it and trying again to open the file.

Another question to clarify. You say "I made several tries, with different apps and different files, but the result was always the same". Does this mean, you have the same issue with other apps?

Earlier investigation seemed to point to the issue, that the app didn't get the permission to open the file, and thus, it appeared empty. Normally, this is not needed, as long as the toaster passes this permission with the file. But this would mean, that the same issue occurs with other app, which don't have a general permission to read files.

Another question: Did you try to open your file directly within the Metronome app? Using the "import"-setting... I guess, this works flawlessly?

But I better wait for you answer, then I will try to investigate a bit further.

brilnius commented 2 years ago

Thank you for your answer.

"I made several tries, with different apps" -> I was talking about the apps for selecting the file to import. As I had 3 of them, I tried each one (when given the choice by the toaster)

[do] you accidentally have MaterialFiles installed

I don't think so. I have no app with "Material" in the name. Should I check for the presence of a particular directory (if this is a lib rather than an app)?

Does this mean, you have the same issue with other apps?

I don't remember any issue like this. I've just tried something similar in the Signal app: the toaster appeared and finally the file was picked with no problem.

Did you try to open your file directly within the Metronome app? Using the "import"-setting... I guess, this works flawlessly?

What do you mean by the "import-setting"? I used the feature "Load scenes from file", is there another way to import a file?

thetwom commented 2 years ago

Thanks for the further details.

MaterialFiles ...

MaterialFiles is a file manager app. I am not totally into it, but normally such apps provide the file-pickers and maybe also interfer with the toasters. But from you answer I take, you did not install it. Can I ask if you use any other custom file manager?

... in the Signal app: the toaster appeared and finally the file was picked with no problem.

Ok, thanks for the Info. I guess Signal has file permissions anyway. But who knows maybe there is still an issue with the metronome app. I hope, I can find out.

What do you mean by the "import-setting"? I used the feature "Load scenes from file", is there another way to import a file?

There are two ways to load a file:

  1. Using an "external" app, e.g. a filemanager and then say "Open file" or similar. Since the metronome app registers to be able to open txt-files, the toaster should appear and present the metronome as one option.
  2. In the "scenes"-view of the metronome use the "Load scenes from file". This is what I guess you are currently doing.

Actually, your answer surprises me. If you use "Load scenes from file", the app delegates the file-choosing to the system. Normally, the system should then present a file-picker, you choose a file, and say "open" or similar and then the metronome becomes visible again. There should be no toaster, since the app request came from the metronome.

My first guess is, that the filemanager is screwing something up (since the filemanager most probably provides the file-picker). But I might be wrong. So as indicated in the beginning, maybe you can let me know, if you use a custom filemanager and if yes, which one you use.

thetwom commented 2 years ago

Just for the record, setting a link to this issue, https://github.com/thetwom/toc2/issues/35#issuecomment-850448115, where at least it is reported that method 2 of opening files does not work. Method 1 seems to work there. As said, I still have to figure out the root cause for it, if it the metronome or the filepicker.

thetwom commented 2 years ago

I hopefully found the root cause for the issue. Maybe you can try the test version: v4.5.1-rc1

thetwom commented 2 years ago

I released now v4.5.1, which should fix the issue.

brilnius commented 2 years ago

Hi thetwom, sorry to take so much time to answer. I've recently upgraded to v4.5.1, and could not reproduce the problem (the most difficult was to remove the "default app" preference so to have again the choice "toaster"). Thank you for all, this issue should be closed for me.