fix: refresh widgets after idle#978
Conversation
efea229 to
295079f
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 295079f67e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Testing notes: Prerequisite: add all OS widgets and lock the phone for a few (15+) minutes. a) Bitkit running in bg
b) Bitkit not running in background (foreground service stopped from the persistent Bitkit notification)
Also noticed this after force shutdown the app - OS widgets loose the content, until tapped on. (however force shutdown warns that this action may cause app misbehavior). Screen_Recording_20260601_162003_One.UI.Home.mp4 |
Resolved in de12165 |
|
Starting review |
jvsena42
left a comment
There was a problem hiding this comment.
Approved with 2 comments:
- There is a duplicated request flow for widgets, maybe we should monitor battery/internet usage
Tested:
- Notifications disabled
- Bitkit in BG
- Leave the phone offline and in idle > 15 min
- unlock the phone and turn on wifi
- Widgets refreshed
…ts-show-stale-data-af
Good point. The unique work names prevent parallel duplicate workers, but the alarm path can still overlap with the periodic worker over time. I’d prefer to keep this PR scoped to fixing the stale-widget bug and follow up with a small throttle/centralized scheduler so we can reduce battery/network churn without weakening the catch-up behavior. Wdyt? |
|
On my side I don't see this case working:
If Bitkit app is not running - which I believe will be the most common case - the widgets don't seem to be refreshed. 🤷 |
…ts-show-stale-data-af
|
FYI, the reason Facts widget updates is because it uses local cached data, so it's not a real update, just rotating cached entries. |
So, my test is really simple, not using any additional commands - not messing with wifi or other settings, just testing on a device. When I make the phone idle (by locking, or just putting away) - and I don't have Bitkit app running - then - after unlocking it after a while I don't see the OS widgets updating - they show old, stale data. They only update if:
That is basically what I observe... btw seeing some slack issues on my side so not sure if you can see my messages there |
Pull request was converted to draft
|
Drafted to refactor into a better solution. (including BOOT wake-up for widgets refresh) |
Resolved in ddf4c64 |
Resolved in ddf4c64 |
19f5fc1 to
ddf4c64
Compare
ddf4c64 to
89bb9cd
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 89bb9cd6b3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
89bb9cd to
cafffb4
Compare
cafffb4 to
718d445
Compare
|
@piotr-iohk refactored into something that worked reliable on my end |






Fixes #975
Description
This PR:
AppWidgetRefreshSchedulerentry point.LightningNodeService.onDestroy.No exact-alarm permission, battery optimization exemption, debug-only shortcut, temporary patch, accelerated wait command, or manual widget refresh UI is added.
Preview
QA Notes
Manual Tests
Result: Real idle wait from 19:15 to 20:43 on June 2, 2026: Price changed from
$67.443to$67.314, Blocks changed from952,132to952,138, News changed headline, and Facts rotated locally. Weather stayed at$0.28, which is valid when the fee estimate itself has not changed.negative:Android quick settings -> disable Wi-Fi/data -> repeat the idle test: remote-backed widgets may stay stale while offline; Facts may still rotate from local cached facts only.negative:Android Settings -> Apps -> Bitkit -> Force stop -> return to launcher: Android 15 may disable widget updates/pending intents until the user launches or interacts with Bitkit again; this is expected platform behavior.Automated Checks
app/src/test/java/to/bitkit/appwidget/.app/src/test/java/to/bitkit/androidServices/LightningNodeServiceTest.kt.git diff --checkpassed locally../gradlew compileDevDebugKotlinpassed locally../gradlew testDevDebugUnitTestpassed locally../gradlew detektpassed locally.