-
Notifications
You must be signed in to change notification settings - Fork 598
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
GPSLogger doesn't notify the user when it can't write to files, leading to data loss #1138
Comments
… service to only after the permission check is complete. In the stop service, only stop the service if notifications are enabled, due to a weird scenario where the service might start and immediately end due to lack of notifications, resulting in an app crash. How did we end up like this. Issue #1138 Issue #1053
I'm currently working on this, at least partially. I'm able to create a channel for errors. I'm able to send an error notification when all permissions have been denied. I'm going to start showing error notifications when file writes fail due to IOException or SecurityException. However, I'm going to try making it a single notification so it doesn't become overwhelming. It could be that each file writer fails and results in a notification but each one overwrites the other... which is a bit weird. Need to think of a way to make this efficient maybe. Here's what the notification looks like: I've chosen Visibility Public and Priority High. I'm assuming a user would want to know that their writes or the app is failing? I can't do anything if the user denies notification permissions! I ran into a really nasty situation where notification permissions were denied while everything else was accepted - I think it's basically this complex StackOverflow thread. The app would think it had all permissions and start the service, but because notifications were denied, it would immediately stop the service, and because the foreground service started but didn't show a notification within 5 seconds, it crashes the app, and starts a crash-restart-crash loop. I've modified the stop service code so that if notification permissions are denied it doesn't stop the app. Weird hacky workaround that's going to make zero sense in 1 month from now 😢 |
So invisible I forgot it was there haha. I was using the built-in |
I was actually thinking about like a pop-up prompt in-app when you open the app or start logging, since that's usually how I start the GPS logging Notification still makes sense for when "Start on bootup" is enabled |
There should be one already when you start logging, if the file write permission is denied, then a popup appears like this And if all permissions denied then that "first time permissions" apologetic prompt should appear already right when the app is launched. Are you not seeing that? I didn't realize you meant in-app. I'm wondering I should probably continue anyway with the notifications since it could cover both use cases, in-app and background service. |
There should be one already when you start logging, if the file write permission is denied, then a popup appears like this
![image](https://github.com/mendhak/gpslogger/assets/746276/2f688f55-e8e1-4b81-9823-3d70bf76d665)
And if all permissions denied then that "first time permissions" apologetic prompt should appear already right when the app is launched. Are you not seeing that?
I am seeing no prompts when I start logging, after the permissions are bugged. I tried manually throwing the permission away by hand, but I did get prompted for it again. So this "GPSLogger didn't prompt me when it couldn't write to the file" issue is probably a bug caused by my phone bugging out in a very weird way (which I haven't figured out how to reproduce or any other technical detail).
One thing I noticed in the detailed view is that the filename doesn't display when logging (with new files for each logging session), but that's pretty hard to notice.
|
If anyone wants/is able to test, an APK is here: https://github.com/mendhak/gpslogger/releases/tag/v131-rc2 Note that if you use the FDroid version of this app, installing this is like new, so you'll lose previous data and settings. |
Sometimes the permission on my phone gets messed up (no idea why or how, just that it does) and I'll have to re-grant some permissions to apps. I often forget to re-grant the permissions for GPSLogger, since it doesn't tell me when it can't write to a file (when starting a new log), so all logs that are recorded while the permissions are broken just don't exist at all.
I've had this issue happen twice, and it took me at least a month to notice the issues in the first place.
Possibly related to #1053
(/e/OS 1.21.1, GPSLogger v130, FP4, not related to battery optimizations since it's about storage permissions and everything's fine when that's fixed)
The text was updated successfully, but these errors were encountered: