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

Saved preferences do not apply after restarting phone #1726

Open
IveMalfunctioned opened this issue Mar 30, 2022 · 55 comments
Open

Saved preferences do not apply after restarting phone #1726

IveMalfunctioned opened this issue Mar 30, 2022 · 55 comments
Labels
area: settings Issues regarding the Settings UI, structure, etc. bug A bug report needs more info Issue requires more information from poster

Comments

@IveMalfunctioned
Copy link

IveMalfunctioned commented Mar 30, 2022

Short description

Describe the bug in a short but concise way.
After florisboard starts at boot my saved preferences did not apply until restarting florisboard manually

Steps to reproduce

  1. Restart phone
  2. Settings do not apply
  3. Manually restarting florisboard fixes this

Environment information

  • FlorisBoard Version: 0.3.13
  • Install Source: F-Droid
  • Device: OnePlus Nord N200
  • Android: "Oxygen OS" Android 11.0.6.0.DE17AA
@IveMalfunctioned IveMalfunctioned added the bug A bug report label Mar 30, 2022
@z0xrv
Copy link
Contributor

z0xrv commented Mar 30, 2022

I can confirm this happens to me, the themes I loaded still there

@patrickgold
Copy link
Member

Thanks for your bug report!

How does the latest stable release, 0.3.14 behave in this instance?

@patrickgold patrickgold added area: settings Issues regarding the Settings UI, structure, etc. needs more info Issue requires more information from poster labels Mar 30, 2022
@z0xrv
Copy link
Contributor

z0xrv commented Mar 30, 2022

I'm using 0.3.15-beta01

@IveMalfunctioned
Copy link
Author

@patrickgold I can't install the 0.3.14 apk, it just says "App not installed." also tried force stopping florisboard to update, but that didn't work

@patrickgold
Copy link
Member

I can't install the 0.3.14 apk, it just says "App not installed." also tried force stopping florisboard to update, but that didn't work

Do you have multiple accounts or profiles (work/private) on your phone? It often time occurs that there's a mismatch of the installation status of FlorisBoard, then exactly the error you describe occurs if FlorisBoard is installed differently on one profile than the another.

@IveMalfunctioned
Copy link
Author

Nope

@ghost
Copy link

ghost commented Apr 16, 2022

F-Droid releases and github releases are built by different people and signed with different keys. If you installed from F-Droid, you must update from F-Droid.

@notjedi
Copy link

notjedi commented Apr 22, 2022

can second this, it happens even on my phone.

additional info

  • version: 0.3.15.
  • OS: LineageOS 18.1.
  • device: miatoll - Poco M2 Pro.

willing to provide more info and/or help closing this issue.

EDIT: seems like this doesn't happen with many people, so we all must have something in common ig?

@patrickgold
Copy link
Member

I still do not know exactly what is causing this issue and it really bugs me, because I understand that it is a really annoying bug.

EDIT: seems like this doesn't happen with many people, so we all must have something in common ig?

Either only a few people notice and report it or it just happens to a few people. The only common trend I found is that all these reports came from Android 11 devices (custom and stock ROMs mixed). Maybe I need to look into the changelog of A11 to see if something has changed in the bootup context that I missed. But interestingly on my OnePlus with A11 this bug does not occur at all, so not sure about my theory either.

@BrudiBanani
Copy link

I also experience this issue on Android 12 on Asus Zenfone 8 with Stock ROM.
After a restart florisboard will load default values for typing in password and than it will not apply my custom config until a manual restart.

@notjedi
Copy link

notjedi commented Apr 23, 2022

i did some findings and here is what i found. this issue happens only when:

  1. force restarting the phone(holding the power button long enough)
  2. powering off the phone (but i suspect that this is only happening on my phone cause LineageOS has some problems with powering off, it actually force restarts my phone when powering off.

Note: this does not happen when during normal restarts(atleast for me).

@theotheroracle
Copy link

it happens consistently every time for me, not just when i force restart, or power-off

@tsiflimagas
Copy link
Collaborator

tsiflimagas commented May 16, 2022

I can reproduce it by killing the app 2-3 times, but only on debug builds, somehow. On release builds, it happens every now and then after rebooting, but the frequency seems random. I'm on Android 12.1.

Edit: I just reproduced it by force stopping a beta version too.

@patrickgold
Copy link
Member

Above PR should be a fix for this bug, at least I wasn't able to reproduce it anymore after applying the fix. If possible, could some of you test out the debug build and give feedback if this is now fixed? (debug build installs separately and does not touch the main installation). This would be incredible help!

Either way this fix (or adjusted based on feedback if needed) will be included in the next beta release and then hopefully there isn't another way how the preferences can accidentally be overwritten again.

@tsiflimagas
Copy link
Collaborator

tsiflimagas commented May 24, 2022

I tried again and again (more than 50 times in sum, probably) and couldn't reproduce it either. Tried several times on a beta build too and went fine as well, also rebooted a few times and settings still persisted as expected. For the record, my storage isn't encrypted (I know, bad decision, not recommended). Not sure if it could make a difference in this case (like would it be useful to be tested on encrypted storage too). For me, it seems fixed, since I'm totally sure it would have occurred again after that many iterations. Great work!

@notjedi
Copy link

notjedi commented May 24, 2022

@patrickgold where do i get the debug build? do i need to build it w android studio?

@tsiflimagas
Copy link
Collaborator

The artifact can he found here https://github.com/florisboard/florisboard/actions/runs/2373952609. Debug builds are built automatically by GitHub Actions when pushing in pull requests.

@notjedi
Copy link

notjedi commented May 24, 2022

still facing the issue, this does not fix the issue even in the debug build

@notjedi
Copy link

notjedi commented May 24, 2022

but one thing that might possibly be insightful is that, after rebooting the phone, only the preferences of florisboard debug build was reset and the normal release build was working fine. i am just randomly guessing here but it feels like maybe the service is being force shutdown and it's not able to save the prefs to the disk? but it doesn't make sense because the prefs are saved as soon as you commit the changes

@patrickgold
Copy link
Member

but one thing that might possibly be insightful is that, after rebooting the phone, only the preferences of florisboard debug build was reset and the normal release build was working fine.

When the device restarts, only the last default keyboard will be loaded and run again, so if it was FlorisBoard Debug (which is the test case here) then it makes sense that only the Debug version is affected. So if you try rebooting the device with FlorisBoard debug, does only the preferences get reset or also custom themes, and does killing and starting the Debug version again after login reload the prefs or are they gone entirely?

@patrickgold
Copy link
Member

I tried again and again (more than 50 times in sum, probably) and couldn't reproduce it either. Tried several times on a beta build too and went fine as well, also rebooted a few times and settings still persisted as expected.

I think maybe my fix just made the bug even rarer but not entirely fix it, atm I am very unsure. The problem is that my method to reproduce this bug (writing a preference before loading the preferences, which happens in the logic too just a bit later normally) absolutely does not want to work anymore after the fix, so I assumed this behavior is now fixed after a lot of restarts and force closes.

For the record, my storage isn't encrypted (I know, bad decision, not recommended)

Modern Android version allows the storage to not be encrypted? That's new for me, I assumed the credential-based file encryption is standard by now.

@notjedi
Copy link

notjedi commented May 24, 2022

When the device restarts, only the last default keyboard will be loaded and run again, so if it was FlorisBoard Debug (which is the test case here) then it makes sense that only the Debug version is affected. So if you try rebooting the device with FlorisBoard debug, does only the preferences get reset or also custom themes, and does killing and starting the Debug version again after login reload the prefs or are they gone entirely?

killing the app doesn't reset the prefs. after rebooting all the prefs are reset, including the themes (it's basically like a newly installed app). killing the app after rebooting doesn't seem to fix the issue. so basically everytime i reboot, it's like the app has cleared it's data.

@patrickgold
Copy link
Member

killing the app doesn't reset the prefs.

That's at least partly good news, this also caused rare issues sometimes.

after rebooting all the prefs are reset, including the themes (it's basically like a newly installed app). killing the app after rebooting doesn't seem to fix the issue. so basically everytime i reboot, it's like the app has cleared it's data.

During the first login after reboot this is expected, because the user data is not yet encrypted. The interesting part is after successful initial login, which themes/prefs are loaded in any text field you tap in?

@theotheroracle
Copy link

@notjedi i dont see the onboarding in release builds, no

@theotheroracle
Copy link

unsure if its relevant at all but i do have microg

@tsiflimagas
Copy link
Collaborator

Modern Android version allows the storage to not be encrypted?

Well, I'm not totally sure, as it could also be some patch custom roms use, but yeah, if you remove encryption entries from the fstab and format the data partition, you'll boot decrypted. If you join some relevant telegram groups, you'll surely bump into flashable zip files which do this job (some also edit boot image). When such tools move around too much though, the negative effect is that many people use them being unaware of the possible consequences.

@GoRaN909
Copy link
Contributor

GoRaN909 commented May 24, 2022

That's definitely possible because this bug was not really occurring for many users to begin with, there has to be something in common which causes this bug on the few selected devices. The only common factor I found is that the Android level is 11 or 12, but even that doe snot mean much as my A11/12 devices run fine, even the stock emulators without Google APIs.

That's so strange I don't know what to do, Ahh you remembered me after A12 improvements for sound & vibration features the Vibrator is working very good even when dark mode and power saving option is Enabled but the Sounds doesn't work at all I tried with turning off the dark mode and power saving mode but still the sounds not work when you typing or tap any other buttons please take a look at them and I wish you do fix that just like the Vibration is there :) @patrickgold

@notjedi
Copy link

notjedi commented May 25, 2022

even i have microg, with lineageos. not sure how it's related but yeah.

@notjedi
Copy link

notjedi commented May 28, 2022

had a new ota update for lineage os today and it magically fixed the issue after updating

@patrickgold
Copy link
Member

had a new ota update for lineage os today and it magically fixed the issue after updating

Could be an indication that there's a bug at the OS level with the device-protected/credential storage switch. Would be an explanation why most users don't experience this bug.

@billie80
Copy link

billie80 commented May 29, 2022

For me this also happens, but the settings are only gone after updates to florisboard. It does not happen with every update though. Last time for the latest 0.13.16 beta04. I think it did not happen for the previous betas of 0.13.16. This is on Android 10 btw.
If more information is required I will gladly provide it if possible.

@theotheroracle
Copy link

for what its worth i havent noticed this issue anymore

@tsiflimagas
Copy link
Collaborator

Yeah, me neither. Right after that initial fix, I actually (like others) got the bug again, one or two times after rebooting, but it's been months since then, and I never got it again. Maybe it got fixed by accident from an unrelated change? I'm curious to hear if anyone else experienced it recently.

@billie80
Copy link

billie80 commented Sep 5, 2022

Didn't experience it either withthe latest releases!

@patrickgold
Copy link
Member

I haven't changed anything explicitly in this regard since my latest fix attempt, so if it is fixed it is completely by accident. This isn't good however, because if this bug can be fixed by accident it can be introduced by accident again.

@theotheroracle
Copy link

i coukd try to narrow down what commit it was fixed in with the ci builds, will take some time tho lol

@tsiflimagas
Copy link
Collaborator

Could it be something in this commit patrickgold/jetpref@2301d0e ? I don't understand the code, it's just near the place the fix commit touched.

@patrickgold
Copy link
Member

Could it be something in this commit patrickgold/jetpref@2301d0e ?

That specific code shouldn't affect this issue, as it just changes the representation of enum values in the serialized state, whereas this issue affects all types of preference data. Either a change in this repo somehow fixed the issue or a change in a dependency, but like I said I don't know which.

@theotheroracle
Copy link

after not experiencing this issue it's suddenly come up again, it's entirely possible it has something to do with the fact i'm now using a google pixel 1 with android 11, whereas i was previously using 12 ? but what i suspect is mostly likely to be the cause is that this phone has a shoddy battery that will sometimes crash, ( not shutdown, just straight to blackscreen ) so that may be part of the issue, the app might get a shutdown signal and try to save preferences and then corrupt them ? dunno, maybe some system where the original settings aren't touched, but they're written to a secondary file which is applied at next start of the keyboard, and if it's corrupted, fallback to the previous file would address the issue ? i know you're busy with nlp stuff rn tho and this would prolly be a pretty big change, but i thought i'd maybe give my 2 cents on what the possible cause / fix could be, thx for the good work as always, cheers

@Alamingazipur
Copy link

Short description

Describe the bug in a short but concise way.
After florisboard starts at boot my saved preferences did not apply until restarting florisboard manually

Steps to reproduce

  1. Restart phone
  2. Settings do not apply
  3. Manually restarting florisboard fixes this

Environment information

  • FlorisBoard Version: 0.3.13
  • Install Source: F-Droid
  • Device: OnePlus Nord N200
  • Android: "Oxygen OS" Android 11.0.6.0.DE17AA

1 similar comment
@Alamingazipur
Copy link

Short description

Describe the bug in a short but concise way.
After florisboard starts at boot my saved preferences did not apply until restarting florisboard manually

Steps to reproduce

  1. Restart phone
  2. Settings do not apply
  3. Manually restarting florisboard fixes this

Environment information

  • FlorisBoard Version: 0.3.13
  • Install Source: F-Droid
  • Device: OnePlus Nord N200
  • Android: "Oxygen OS" Android 11.0.6.0.DE17AA

@Alamingazipur
Copy link

but one thing that might possibly be insightful is that, after rebooting the phone, only the preferences of florisboard debug build was reset and the normal release build was working fine.

When the device restarts, only the last default keyboard will be loaded and run again, so if it was FlorisBoard Debug (which is the test case here) then it makes sense that only the Debug version is affected. So if you try rebooting the device with FlorisBoard debug, does only the preferences get reset or also custom themes, and does killing and starting the Debug version again after login reload the prefs or are they gone entirely?

@sleepysleepyhead
Copy link

just saying that i had zero issues with florisboard before but then i changed the main language from american english to bri'ish and now i have this problem...

@sleepysleepyhead
Copy link

an update: i switched back to american english and the settings stopped going back to default. even with forced reboots

@tsiflimagas
Copy link
Collaborator

Thank you @sleepysleepyhead for the observation! Also, @axelsimon faced this bug and he happened to be using English (United Kingdom) layout too. That's suspicious...

@theotheroracle
Copy link

i think i may have been on the canadian layout when i was experiencing this tbh

@atikattar1104
Copy link

atikattar1104 commented Apr 17, 2024

For me this also happens, but the settings are only gone after updates to florisboard. It does not happen with every update though.

This is on Android 10 btw. If more information is required I will gladly provide it if possible.

I Agree With This. Only Happens Sometimes (1-2 Times, In 2-3 Years To Be Exact), But Entire App Resets To Default As Initial Install. Thankfully, It Is Rare.

@rancidfrog
Copy link

The problem occurs with me when phone switches off due to low battery.
After connecting phone to charge and switch on, florisboard loses all settings,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: settings Issues regarding the Settings UI, structure, etc. bug A bug report needs more info Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests