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

Resend pending update notifications after reboot for better reliability and security #1482

Open
pxlkng opened this issue Mar 18, 2024 · 6 comments
Labels
enhancement New feature or request

Comments

@pxlkng
Copy link

pxlkng commented Mar 18, 2024

Currently "update available" notifications only get sent once.

Consider the following scenario:

  • Phone is laying around unused (e.g. user sleeping)
  • Obtainium checks for updates, finds one, and notifies
  • The phone restarts, to perform an automatic system update (for example) or due to auto-reboot (GrapheneOS)
  • The user didn't see the notification before the phone rebooted
  • Now when the user starts using the phone again, they will not be notified again about the available update and only notice it should they actively open Obtainium at some point, therefore missing the update completely

I consider this an issue especially in time-sensitive scenarios where an update may fix a security vulnerability in an app; the notifications should be reliable.
This already happened to me multiple times.

My suggestion is to resend still pending update notifications after the phone was rebooted and Obtainium starts up again.
(By just sending out a notification for every pending app update, ignoring if they have already been sent, when Obtainium starts for the first time, once)

This would make sure that the user keeps being reliably notified about available updates.

@pxlkng pxlkng added enhancement New feature or request to check Issue has not been reviewed labels Mar 18, 2024
@ImranR98
Copy link
Owner

I don't think this is realistic. We would have to maintain a list of currently-posted notifications, and keep it in sync at all times - this would likely require running Obtainium in the background constantly (instead of a few seconds every 15 minutes as we do now).

As far as I know, restoring notifications on reboot isn't something most apps do - it would make more sense for Android to build this in rather than for each app to implement it.

@ImranR98 ImranR98 closed this as not planned Won't fix, can't repro, duplicate, stale Mar 19, 2024
@ImranR98 ImranR98 removed the to check Issue has not been reviewed label Mar 19, 2024
@pxlkng
Copy link
Author

pxlkng commented Mar 19, 2024

@ImranR98 I think there was a misunderstanding.

I don't see why you would have to do such a complex thing for this.

Obtainium does already check for updates right on first startup.
But Obtanium will never notify about the same app update twice. Only once. It remembers updates that have already been found and will not notify about those again.

I'm only requesting that on Obtainium's first run you ignore that and notify about every update, just as if they would have been found for the first time. (Basically forgetting which updates had been found pre-reboot, no new list or anything)

The only thing you would have to implement for that, for example, is to have the update-notification dispatch logic on Obtainium's first run ignore the list of updates that already have been found and send out a new update notification for every one regardless. That should be a simple non-invasive addition.
Nothing more. Everything else stays untouched. No restoring notifications from a list or keeping in sync or having Obtainium run constantly. Thats not what I was going for.

Please reconsider this as it would be a huge reliability and security improvement.
Otherwise please help me understand why this feature is too difficult or unrealistic to implement in your opinion.

Thank you for making Obtainium.

@ImranR98
Copy link
Owner

I see what you mean now. Your approach is definitely a lot more doable than what I was thinking, but the downside is that we're not really restoring only the notifications that the user missed - we're re-sending all notifications for all apps that have an update available, regardless of whether or not the user has already seen and dismissed those notifications before.

I guess it could be an optional setting - leave it up to the user.

@ImranR98 ImranR98 reopened this Mar 19, 2024
@ImranR98
Copy link
Owner

The background task would also need a way to tell whether or not it is the first one after a reboot, which is probably possible but I haven't checked.

@pxlkng
Copy link
Author

pxlkng commented Mar 19, 2024

I see what you mean now. Your approach is definitely a lot more doable than what I was thinking, but the downside is that we're not really restoring only the notifications that the user missed - we're re-sending all notifications for all apps that have an update available, regardless of whether or not the user has already seen and dismissed those notifications before.

I guess it could be an optional setting - leave it up to the user.

That's true, though I think the cases in which a user is purposefully dismissing an update (without just procrastinating or ignoring it for the moment) are probably relatively rare, so even in those cases reminding them about the update probably isn't a bad thing and keeps them from forgetting that they skipped one.

And I agree, a setting for this is a great idea, always keep the user in charge.
I feel like it would be a good default to have it enabled though.

@DwainZwerg
Copy link
Contributor

we're re-sending all notifications for all apps that have an update available, regardless of whether or not the user has already seen and dismissed those notifications before.

That's what the "Skip update notifications" toggle is for. Of course, you could also add the toggle "Skip update notification for this release", but I don't think this is really necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants