-
Notifications
You must be signed in to change notification settings - Fork 623
Improve widget performance #4922
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
Merged
brentsimmons
merged 19 commits into
Ranchero-Software:main
from
stuartbreckenridge:improve-widget-performance
Jan 8, 2026
Merged
Improve widget performance #4922
brentsimmons
merged 19 commits into
Ranchero-Software:main
from
stuartbreckenridge:improve-widget-performance
Jan 8, 2026
+297
−220
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Change widget update policy to never to give app more control of refresh timings.
…use non-optional method). Make sure accessToken doesn’t have a trailing \n character.
Change widget update policy to never to give app more control of refresh timings.
…tbreckenridge/NetNewsWire into improve-widget-performance
Rewrite `encode()`: - Remove file removal checks, writing data will replace - Compare existing widget data to new data and determine which widgets actually need refreshed Refactor `flushSharedContainer` to `removeStaleFaviconsFromSharedContainer`: - No longer nuked in full - Only favicons not accessed in the last seven days are deleted (in DEBUG builds this is 30 seconds) Improve `writeImageDataToSharedContainer`: - Favicons now use their md5 digest instead of a UUID (thus one image per feed, instead of one image per article) - If the favicon exists it is not rewritten Add `reloadTimelines`: - Compares existing article arrays to new article arrays and will only reload specific widget timelines where there is a difference. - `LatestArticle` now conforms to `Hashable` to make this possible. Improve `SceneDelegate` selection logic: - select the correct feed before selecting the article
When the widget encoding is completed asynchronously and wrapped in `Task { @mainactor in }`, the app rarely (if ever) refreshes the widget unless attached to the debugger (in which case, unhelpfully, it works fine).
My thinking is that the app is being terminated _before_ `encode` is complete and therefore the call to refresh widget timelines is not happening consistently.
Moving the widget to synchronous encoding has resolved the widget refresh behaviour.
Improve `SceneDelegate` selection logic: - select the correct feed before selecting the article
brentsimmons
approved these changes
Jan 8, 2026
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR will fix #4921 and provides the following enhancements:
Rewrite
encode():Refactor
flushSharedContainertoremoveStaleFaviconsFromSharedContainer:Improve
writeImageDataToSharedContainer:Add
reloadTimelines:LatestArticlenow conforms toHashableto make this possible.Improve
SceneDelegateselection logic:Widget encoding is now synchronous:
Task { @MainActor in }theencode()function doesn't have time to complete before requesting a timeline refresh; it's now synchronous.NEW Lock Screen Summary Widget: