Honor explicit Home and Gaming refreshes - #113
Open
Jim8y wants to merge 1 commit into
Open
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
The changes are small and well-scoped, and the added tests directly validate both the intent propagation (Home/Gaming) and the production cache behavior for forced refreshes.
Pull request overview
This PR fixes audit item P2-08 by ensuring that an explicit user-initiated refresh on Home (banners/news) and Gaming (catalog) bypasses the cache TTL and performs a fresh fetch, while preserving existing automatic-load caching behavior.
Changes:
- Added an optional
forceRefreshflag toCachedCollection.LoadAsync(...)and used it to bypass the TTL early-return. - Propagated “manual refresh” intent by passing
LoadingService.IsReloadinginto Home and Gaming cache loads. - Added targeted test projects verifying refresh intent propagation and forced-refresh cache behavior (including future timestamps and failure cases).
File summaries
| File | Description |
|---|---|
OneGateApp/Models/CachedCollection.cs |
Adds forceRefresh option and uses it to bypass the TTL check for explicit refreshes. |
OneGateApp/Pages/HomePage.xaml.cs |
Forces banner/news reload when LoadingService is executing a manual refresh. |
OneGateApp/Pages/GamingPage.xaml.cs |
Forces DApp catalog reload when LoadingService is executing a manual refresh. |
tests/p2-08/TestBoundary.cs |
Adds MAUI/test boundary shims and a lightweight CachedCollection stub to validate refresh intent propagation. |
tests/p2-08/RefreshIntentTests.cs |
Verifies Home/Gaming manual refresh sets forceRefresh=true while automatic load uses false. |
tests/p2-08/RefreshIntent.Tests.csproj |
Adds linked-source test project for intent propagation without MAUI workloads. |
tests/p2-08-cache/CacheBoundary.cs |
Adds cache/HTTP boundary fixture using real EF Core + SQLite-in-memory for production-cache tests. |
tests/p2-08-cache/ForcedRefreshTests.cs |
Verifies forced refresh bypasses TTL/future timestamps and does not update timestamps on failure. |
tests/p2-08-cache/ForcedRefresh.Tests.csproj |
Adds linked-source test project that compiles production CachedCollection against SQLite. |
OneGateApp.slnx |
Includes the two new test projects in the solution. |
Review details
- Files reviewed: 10/10 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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
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.
Summary
Fix audit P2-08: an explicit Home/Gaming refresh should fetch fresh content instead of returning immediately because the cache TTL has not expired.
forceRefreshflag to CachedCollection without changing ordinary automatic-load behavior.Validation
dotnet test tests/p2-08/RefreshIntent.Tests.csproj --no-restore --nologo: 2/2 passed.dotnet test tests/p2-08-cache/ForcedRefresh.Tests.csproj --no-restore --nologo: 2/2 passed, using the production cache implementation and SQLite.a6465f5ea0d61217456d0cb5b93750c45214aff23d6fd888d8e33f214836fa54; matched to both native evidence sets before committing.Limitations and integration
Controlled native HTTP verifies refresh intent and results, not production-server availability. No signing or chain submission was performed; screenshots/fixtures remain outside the repository and are not attached here, and local passes are not hosted CI results.
Independently based and validated on
master@623603d; retain the union of solution test entries and rerun validation after integration changes rather than treating this as combined audit validation. Integrating audit P2-09/P2-07 must retain cache identity updates and offline/preference handling as well as forced refresh; update the P2-08-cache linked sources and VersionedItem boundary for P2-09'sICachedEntityconstraint.