bug(daily-challenge): stale date cache when app runs past midnight #60
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Bug
daily_challenge_plugin.rscaches the current date when the daily challenge is loaded. If the app stays open past midnight, the cached date becomes stale and the challenge is no longer for the correct day. The player can continue playing yesterday's challenge indefinitely without triggering a refresh.Affected file
solitaire_engine/src/daily_challenge_plugin.rsFix
On each tick (or on app resume), compare the cached date against the current system date. If they differ, invalidate the cache and reload the challenge for the new date. Consider also handling the app-resume / foreground event on Android/iOS where the OS may have advanced the clock significantly.