sailfishos-applications / flowplayer

Music Player for SailfishOS
https://openrepos.net/content/olf/flowplayer
Other
6 stars 7 forks source link

[Bug] Changes made in settings do not survive app restart #99

Closed tuplasuhveli closed 5 months ago

tuplasuhveli commented 6 months ago

SailfishOS VERSION 4.5.0.25
HARDWARE Sony Xperia 10 III
FlowPlayer VERSION 0.3.5

BUG DESCRIPTION

Any changes made in the Settings page are switched back to default after restarting the app. This is problematic especially when changing the language, since applying a new language requires a restart, but the change in the settings is reverted at restart.

STEPS TO REPRODUCE

  1. Open the top pulley menu to go into Settings.
  2. Change any setting you desire.
  3. Restart the app.
  4. Notice the change being reverted back to default.

ADDITIONAL INFORMATION

When using "Manage folders", the changes are not reverted, even though no folders are shown in the list after a restart.

Olf0 commented 5 months ago

@tuplasuhveli, thank you for your concise bug report.

A quick question first: "the changes" you mention in the section "ADDITIONAL INFORMATION" address the changes you made on the "Manage folders" page, right? And only these changes, all other settings you alter are discarded when you close FlowPlayer, correct?

On a pre-SailJail installation of SailfishOS (3.2.1) this issue is not reproducible with FlowPlayer 0.3.5: Changes in FlowPlayer's settings survived closing and then starting FlowPlayer again.

As sandboxing was introduced by v0.3.5 (see PR #77), you can check with FlowPlayer 0.3.4 that this bug is related to it. I assume so, but better be sure.

Spontaneously I can think of two reasons:

  1. (Some or all) saved settings are in a location outside a SailJail permitted path. This should not be the case AFAIR, but has to be checked. Jolla provides some guidance for debugging apps trying to violate SailJail permissions: sailfishos/sailjail/APPDEBUG.md Maybe you have time and motivation to go through this guidance.
  2. A permission is wrongly used or missing, see sailfishos/sailjail-permissions/README.md for details. This README contains a list of accesses an app is allowed to do: AFAICS FlowPlayer's settings are within that, but this needs to be checked thoroughly. The SailJail permissions FlowPlayer currently acquires can be seen here.

Maybe @dcaliste (co-author of PR #77) or @poetaster (original author of PR #77) has an idea what goes wrong here.

P.S.: @tuplasuhveli, I wonder a bit why nobody else complained since the release of FlowPlayer 0.3.5: This should affect almost all users (i.e. all users of FlowPlayer 0.3.5 on SailfishOS ≥ 4.4.0). Can you think of anything being special about your SailfishOS installation? Does any other app behave similarly?

P.P.S.: Note that I am neither using FlowPlayer or writing code for it; I merely coordinate its maintenance and take care about release management, translations infrastructure and automatisation, CI workflows, GH repo config, RPM packaging, keeping READMEs up-to-date, etc.

tuplasuhveli commented 5 months ago

Hey @Olf0, I'm so sorry I had completely missed your reply.

Apparently the issue seems to be fixed now, but since I broke my only phone capable of running SFOS, I'm not able to test the fix. Thank you both, especially @dcaliste for doing the hard work!

RTheren commented 1 week ago

Hello there.

I can still replicate this issue on both Jolla C2 (running SailfishOS 5.0.0.29) and Xperia 10 ( SailfishOS 4.6.0.15).

Changing any setting in Settings (regardless of whether you use Manage folders) resets them when you stop the app.

FlowPlayer version is 0.3.5 from Storeman.

Looking at journalctl when launching the player shows something that might be the culprit

Nov 27 11:58:35 JollaC2 invoker[56430]: warning: enforcing sandboxing for '/usr/bin/flowplayer' Nov 27 11:58:35 JollaC2 invoker[56430]: Error: can't chdir to privileged Nov 27 11:58:35 JollaC2 invoker[56430]: Warning: "shell none" command in the profile file is done by default; the command will be deprecated Nov 27 11:58:35 JollaC2 invoker[56430]: constructing /run/firejail/mnt/privileged: Images ... Nov 27 11:58:35 JollaC2 invoker[56430]: mounting /run/firejail/mnt/privileged @ /home/defaultuser/.local/share/system/privileged Nov 27 11:58:35 JollaC2 invoker[56430]: hiding /run/firejail/mnt/privileged Nov 27 11:58:35 JollaC2 invoker[56430]: Error: can't chdir to privileged

Olf0 commented 1 week ago

@RTheren, thank you for reporting that this appears to be an issue (either "still" or "again").

Unfortunately I have no idea, because I do not know much about SailJail / Firejail and I do not use FlowPlayer (I just barely manage its maintenance, releases, infrastructure etc.). Maybe @dcaliste has an idea how address this.

Bullshit, I forgot to create a v0.3.6 release which incorporates this fix. Sorry, will do … maybe this weekend. Thank you very much for notifying me that this job was not properly finished yet.

RTheren commented 1 week ago

Thank you Olf. Once it's out, I will retest it and post here if it happens again :)

Olf0 commented 6 days ago

Once it's out, I will retest it and post here if it happens again :)

Can you please manually install the RPM file for aarch64 from the ZIP-archive for SailfishOS 4.3.0.12+ of FlowPlayer 0.3.6 on GitHub's releases page. Edit: Or more conveniently from SailfishOS:Chum:Testing, which e.g. can be selected in the settings of the SailfishOS:Chum GUI app.

As you offered to test it, I gladly use your offer to avoid releasing an untested version at OpenRepos and SailfishOS:Chum.

Thank you very much!

RTheren commented 6 days ago

I've downloaded the RPM from Release page and installed it. Can confirm the settings are indeed preserved after restarting.

Olf0 commented 3 days ago

Thanks for testing: FlowPlayer 0.3.6 is available at OpenRepos and SailfishOS:Chum now.