Skip to content

Show indexer-unreachable popup instead of silent failure (#971) - #972

Open
dangershony wants to merge 1 commit into
mainfrom
feature/indexer-health-check-popup-971
Open

dangershony wants to merge 1 commit into
mainfrom
feature/indexer-health-check-popup-971

Conversation

@dangershony

Copy link
Copy Markdown
Member

Summary

Implements issue #971, with a deliberate design change agreed with the maintainer: no automatic fallback. When the currently selected primary indexer fails to respond, the app shows a picker popup directly instead of silently retrying other configured indexers.

Scoped to \src/design/App\ (the new Avalonia rewrite) plus the shared/SDK plumbing it depends on, per repo conventions. \src/webapp\ and \src/avalonia\ (dead code) are untouched.

Changes

Shared layer (\src/shared/Angor.Shared)

  • New \IndexerUnreachableEventArgs\ model.
  • \INetworkService/\NetworkService: added an \IndexerUnreachable\ event and \NotifyIndexerUnreachable(url, reason)\ method. Marks the indexer offline in storage and raises the event, debounced (20s) per indexer URL so a burst of concurrent failing requests doesn't flood subscribers.
  • \MempoolSpaceIndexerApi: every failure path (timeout/exception, or a non-success HTTP response) now calls \NotifyIndexerUnreachable\ before throwing/returning. No attempt is made to silently retry against a different indexer.
  • Updated \TestNetworkService\ test double to implement the new interface members.

App layer (\src/design/App)

  • New \IndexerUnreachableModalViewModel\ + \IndexerUnreachableModal\ view, following the existing \ModalCard\ sizing convention and the \WalletSwitcherModal\ pattern. Lists all configured indexers with status, lets the user pick one to use as primary, or add a custom URL.
  • \ShellViewModel\ subscribes to \INetworkService.IndexerUnreachable\ and shows this modal directly via \ShowModal(...), guarded so only one popup is shown at a time.

Testing

  • \dotnet build\ clean on \Angor.Shared, \Angor.Sdk.Tests, \App, \App.Desktop.
  • \dotnet test src/sdk/Angor.Sdk.Tests: 349 passed, 0 failed.
  • \dotnet test src/shared/Angor.Shared.Tests: 160 passed, 0 failed.
  • \dotnet test src/design/App.Test.Integration --filter FullyQualifiedName~LayoutRegression: 187 passed, 0 failed (confirms the shell/modal changes don't break any view layout).

Follow-ups (not included in this PR)

  • A dedicated UAT test exercising an actual unreachable indexer end-to-end.
  • A \LayoutRegression\ entry specifically for the new modal.

Closes #971

Implements a manual-picker response to issue #971 without automatic
fallback: when the currently selected primary indexer fails to respond
to a request, MempoolSpaceIndexerApi now calls
INetworkService.NotifyIndexerUnreachable, which marks the indexer
offline and raises an IndexerUnreachable event (debounced per indexer
to avoid flooding subscribers from concurrent failing requests).

In src/design/App, ShellViewModel subscribes to this event and shows
a new IndexerUnreachableModal directly (no background retry loop),
letting the user pick a different configured indexer or add a custom
URL. Selecting an indexer just sets it as primary and persists it -
no automatic verification/fallback chain is attempted.

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add indexer health-check + fallback (with manual picker) when the primary indexer is unreachable

1 participant