Skip to content

fix: isolate search loading failures by result group - #116

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

fix: isolate search loading failures by result group#116
Jim8y wants to merge 1 commit into
neoorder:masterfrom
Jim8y:fix/audit-p2-10

Conversation

@Jim8y

@Jim8y Jim8y commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Summary

Fix audit P2-10: keep usable search groups available when another data source is slow or fails.

  • Publish contacts/settings before independent asset/catalog network loading. Serialize shared DbContext reads rather than starting competing database queries.
  • Report group-level failures with retry; rebuild results after each group, including already-cached catalog data after a refresh failure.
  • Clear old DApp search entries while discovery settings are pending/unreadable, and reject stale DApp taps. Do not let an old developer index remain accessible after settings failure.

Validation before commit

  • 7 local regression tests exercise production search loading with controlled boundaries.
  • iOS 26.5 and Android API 36 ARM64: 8/8 native assertions on each, running the real GlobalSearchPage, disposable SQLite contacts/catalog, production token/RPC loading, controlled HTTP and actual EF settings-read failure interception.
  • Verified local results while RPC is pending, RPC/price/catalog failures isolated from usable groups, cached catalog availability, fail-closed settings behavior and recovery using the current policy. The actual search UI displayed the expected local contact and catalog app.
  • Both platforms then passed fixture-free full product Rebuild/install/startup smoke. No OneGate app crash observed; Android's device-wide log contains unrelated system Bluetooth crashes and is not described as empty.
  • Source patch SHA-256: 89333059895d1e7ad950b82805175ce37a3ca56fa71ef691a40ff65dd9e3d75b. No signing or chain broadcasts. Screenshots and QA fixture stay outside the repository; no upload is claimed.

Integration

Independently validated on master 623603d634f07eaead14745da87920a356159be0. Coordinate with P2-12's preference filtering and P2-11 / #109: preserve fail-closed policy, partial error/retry behavior, and immediate-Enter current-query handling. Adapt linked-source test boundaries to the combined page and rerun all three suites/native flows. Preserve the solution-project union. No combined 25-PR validation is claimed.

Copilot AI lite review requested due to automatic review settings September 5, 2026 08:00

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.

🟡 Changes recommended

Concurrent group failures can race while updating SearchErrorText, potentially dropping error lines and producing incorrect error reporting.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Improves GlobalSearchPage resilience by isolating search loading failures per result group, keeping usable local/cached results visible when other sources are slow or failing, and enforcing a fail-closed policy for discovery settings.

Changes:

  • Reworked search data loading to (1) clear stale DApp results up front, (2) serialize DbContext-based reads, and (3) load independent groups with group-level error reporting + retry.
  • Added UI for group-level failures (error card + Retry button) and prevented launching stale DApp results after settings/index invalidation.
  • Added a linked-source test project validating partial availability, pending/failing settings behavior, and retry recovery.
File summaries
File Description
tests/p2-10/TestBoundary.cs Adds test-only boundary stubs to run linked-source GlobalSearchPage logic without MAUI workloads.
tests/p2-10/SearchAvailabilityTests.cs New regression tests for group isolation, settings fail-closed behavior, and retry recovery.
tests/p2-10/SearchAvailability.Tests.csproj Introduces the net10.0 test project and links the production GlobalSearchPage.xaml.cs.
OneGateApp/Pages/GlobalSearchPage.xaml.cs Implements group-based loading, error aggregation, fail-closed DApp index clearing, and stale DApp tap rejection.
OneGateApp/Pages/GlobalSearchPage.xaml Adds an error card with retry action and ensures empty state doesn’t display when errors exist.
OneGateApp.slnx Includes the new p2-10 test project in the solution.
Review details
  • Files reviewed: 6/6 changed files
  • Comments generated: 2
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +108 to +126

async Task LoadSearchGroupAsync(Func<Task> load, string group)
{
try
{
await load();
}
catch (Exception)
{
string message = $"{group}: {Strings.Unavailable}";
SearchErrorText = string.IsNullOrEmpty(SearchErrorText)
? message
: $"{SearchErrorText}{Environment.NewLine}{message}";
}
finally
{
UpdateResults();
}
}
Comment on lines +144 to +155
// CachedCollection has already loaded disk data even when refreshing
// the network fails. Keep those usable results alongside the error.
dappIndex = DApps
.Where(p => p.IsRegularApp && DAppCatalogPolicy.IsDiscoverable(p, developerModeEnabled))
.Select(p => new GlobalSearchIndex<DApp>(
p,
recentDAppIds.IndexOf(p.Id),
p.NameLocalizer.Localize(),
p.DescriptionLocalizer?.Localize(),
p.Url,
p.Tags is null ? null : string.Join(' ', p.Tags.Select(DApp.LocalizeTag))))
.ToArray();
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