Conversation
Greptile SummaryThis PR fixes stale data in the "recent dishes" list by hooking its cache invalidation into the pull-to-refresh flow of the SKS menu screen, and reduces its TTL from 1 day (
The implementation is consistent with existing patterns and introduces no new technical debt. Confidence Score: 5/5Safe to merge — changes are minimal, follow established codebase patterns, and introduce no new risk. All changes are P2 or lower. The new clearCache() method mirrors the identical method already present in SksMenuRepository, the TTL reduction is intentional and consistent with the live-menu policy, and the coordinated refresh in the screen correctly follows the clear-before-refresh ordering already used for the menu provider. No logic bugs, security concerns, or data-integrity issues were found. No files require special attention. Important Files Changed
Sequence DiagramsequenceDiagram
participant U as User (pull-to-refresh)
participant Screen as _SksMenuView
participant MenuRepo as SksMenuRepository
participant FavRepo as SksFavouriteDishesRepository
participant Cache as CacheManager
U->>Screen: onRefresh triggered
par Clear caches in parallel
Screen->>MenuRepo: clearCache()
MenuRepo->>Cache: removeFile(/meals/current)
MenuRepo->>Cache: removeFile(/info)
and
Screen->>FavRepo: clearCache()
FavRepo->>Cache: removeFile(/meals/recent)
end
par Refresh providers in parallel
Screen->>MenuRepo: ref.refresh(future)
MenuRepo-->>Screen: ExtendedSksMenuResponse
and
Screen->>FavRepo: ref.refresh(future)
FavRepo-->>Screen: SksFavouriteDishesMap
and
Screen->>Screen: ref.refresh(getLatestSksUserDataProvider.future)
end
Screen-->>U: UI updated
Reviews (3): Last reviewed commit: "chore: reorder imports" | Re-trigger Greptile |
Although the bug couldn't be confirmed on my end, I've prepared a potential fix.
Pulling down to refresh on the current meals screen now also refreshes the recent dishes list. Additionally, the cache duration has been reduced from 1 day to 1 hour, bringing it in line with the current menu behavior.
Hopefully this addresses the issue.