Read the time through TimeProvider in GalaxyCloudReader and AppsMenuEntry #179

Closed
opened 2026-10-26 17:56:26 -05:00 by ethan-hann · 1 comment
Owner

Two classes read the wall clock directly, so no test can move their time.

  • src/Savepoint.Core/CloudSaves/GalaxyCloudReader.cs, GalaxyCloudReader.SweepLeftovers: compares DateTime.UtcNow with a folder's write time to find leftovers. Take a TimeProvider and pass BackendOptions.Time from CoreBackend.GalaxyReader. Breaks .agents/coding-standards/core-injected-side-effects.md.
  • src/Savepoint.App/Platform/AppsMenuEntry.cs, AppsMenuEntry: stamps the hicolor folder with DateTime.UtcNow. Use the clock from FeatureContext.Clock. Breaks .agents/coding-standards/app-mvvm-view-models.md.

Done when grep -rnE --include=*.cs "DateTime(Offset)?\.(Now|UtcNow)" src prints nothing, with a test that moves the clock past the leftover age.

Two classes read the wall clock directly, so no test can move their time. - `src/Savepoint.Core/CloudSaves/GalaxyCloudReader.cs`, `GalaxyCloudReader.SweepLeftovers`: compares `DateTime.UtcNow` with a folder's write time to find leftovers. Take a `TimeProvider` and pass `BackendOptions.Time` from `CoreBackend.GalaxyReader`. Breaks `.agents/coding-standards/core-injected-side-effects.md`. - `src/Savepoint.App/Platform/AppsMenuEntry.cs`, `AppsMenuEntry`: stamps the hicolor folder with `DateTime.UtcNow`. Use the clock from `FeatureContext.Clock`. Breaks `.agents/coding-standards/app-mvvm-view-models.md`. Done when `grep -rnE --include=*.cs "DateTime(Offset)?\.(Now|UtcNow)" src` prints nothing, with a test that moves the clock past the leftover age.
ethan-hann added this to the Code Cleanup milestone 2026-10-26 17:56:26 -05:00
Author
Owner

Shipped in 0.9.17 (PR 227).

Shipped in [0.9.17](https://git.tortal.tech/ethan-hann/SavePoint/releases/tag/v0.9.17) (PR 227).
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
ethan-hann/SavePoint#179
No description provided.