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.
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
• Ensure counts do not wrap
• Reduces number of articles on large widget due to increased spacing.
• Consistent vertical spacing between articles and dividers