Skip to content

Honor explicit Home and Gaming refreshes - #113

Open
Jim8y wants to merge 1 commit into
neoorder:masterfrom
Jim8y:fix/audit-p2-08
Open

Honor explicit Home and Gaming refreshes#113
Jim8y wants to merge 1 commit into
neoorder:masterfrom
Jim8y:fix/audit-p2-08

Conversation

@Jim8y

@Jim8y Jim8y commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

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.

  • Add an optional forceRefresh flag to CachedCollection without changing ordinary automatic-load behavior.
  • Pass manual-refresh intent from Home banners/news and Gaming catalog loading.
  • Preserve cache timestamps after a failed forced request, including when the existing timestamp is in the future.

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.
  • iOS 26.5 simulator and Android API 36 arm64 emulator: four native assertions passed on each platform through actual HomePage/GamingPage and production LoadingService/CachedCollection with disposable SQLite and controlled HTTP. Automatic loads retained the cache; manual refreshes fetched and displayed fresh news/banner/game data.
  • The external fixture was then removed, followed by a separate product rebuild/install/launch on each platform. Normal Home/four tabs rendered, with no OneGate app crash observed.
  • Final tested source patch SHA-256: 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's ICachedEntity constraint.

Copilot AI lite review requested due to automatic review settings September 5, 2026 07:59

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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 forceRefresh flag to CachedCollection.LoadAsync(...) and used it to bypass the TTL early-return.
  • Propagated “manual refresh” intent by passing LoadingService.IsReloading into 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants