Skip to content

fix showing unlock when server is unreachable#570

Merged
bordalix merged 1 commit intomasterfrom
server_unreachable
Apr 28, 2026
Merged

fix showing unlock when server is unreachable#570
bordalix merged 1 commit intomasterfrom
server_unreachable

Conversation

@bordalix
Copy link
Copy Markdown
Collaborator

@bordalix bordalix commented Apr 28, 2026

Avoid showing unlock screen (even when wallet is not locked) when arkd is unreachable.

Summary by CodeRabbit

  • Bug Fixes
    • Improved unlock page routing logic to handle scenarios where the authentication service is unreachable. The app now correctly manages page selection when users have a stored wallet but the service becomes unavailable, preventing unexpected page displays during service interruptions.

@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying wallet-mutinynet with  Cloudflare Pages  Cloudflare Pages

Latest commit: 4f9bf6f
Status: ✅  Deploy successful!
Preview URL: https://99151509.arkade-wallet.pages.dev
Branch Preview URL: https://server-unreachable.arkade-wallet.pages.dev

View logs

@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying wallet-bitcoin with  Cloudflare Pages  Cloudflare Pages

Latest commit: 4f9bf6f
Status: ✅  Deploy successful!
Preview URL: https://4c9deafd.wallet-bitcoin.pages.dev
Branch Preview URL: https://server-unreachable.wallet-bitcoin.pages.dev

View logs

@bordalix bordalix requested a review from pietro909 April 28, 2026 10:38
@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying tmp-boltz-upstream-mainnet-arkade-wallet with  Cloudflare Pages  Cloudflare Pages

Latest commit: 4f9bf6f
Status: ✅  Deploy successful!
Preview URL: https://e2790467.tmp-boltz-upstream-mainnet-arkade-wallet.pages.dev
Branch Preview URL: https://server-unreachable.tmp-boltz-upstream-mainnet-arkade-wallet.pages.dev

View logs

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 28, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b147fa2d-d645-4009-8643-d92418be3f4f

📥 Commits

Reviewing files that changed from the base of the PR and between 720fe00 and 4f9bf6f.

📒 Files selected for processing (1)
  • src/App.tsx

Walkthrough

The shouldShowUnlock condition in src/App.tsx is tightened by adding an additional check that aspInfo.unreachable is false. This prevents the Unlock page from being displayed when the wallet is stored and locked but the ASP backend is unreachable.

Changes

Cohort / File(s) Summary
Routing Logic Enhancement
src/App.tsx
Tightened shouldShowUnlock condition to additionally verify that aspInfo.unreachable is false, preventing Unlock page display when the ASP backend is unreachable.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

Suggested reviewers

  • pietro909
  • louisinger
  • Kukks
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: preventing the unlock page from displaying when the server is unreachable, which matches the core modification in src/App.tsx.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch server_unreachable

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@arkanaai arkanaai Bot left a comment

Choose a reason for hiding this comment

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

Review: ✅ Approved

1-line change, clean fix. Traced the full rendering pipeline to verify correctness.

What it does

When the ASP (arkd) is unreachable and the wallet is locked, the shouldShowUnlock guard on App.tsx:135 was forcing the rendered page to Pages.Unlock (line 175), overriding the navigation effect that already correctly routes to Pages.Unavailable (line 98). Adding && !aspInfo.unreachable lets the Unavailable screen render as intended.

Security check — lock bypass risk: None

Verified that going offline cannot expose wallet data:

  • When aspInfo.unreachable is true and authState === 'locked':
    • shouldShowUnlockfalse (this fix)
    • shouldHoldOnLoadingfalse (because authState === 'locked' short-circuits it)
    • page resolves to screen, which the useEffect has set to Pages.Unavailable
  • The Unavailable page renders with Tabs.None — no wallet content, no navbar
  • The wallet data remains locked; unlockWallet() is never called

Not protocol-critical

This is a UI routing fix in the frontend wallet. No VTXO handling, transaction signing, or fund movement logic is touched.

LGTM — ship it.

🤖 Reviewed by Arkana

@bordalix bordalix merged commit c0c70aa into master Apr 28, 2026
6 checks passed
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.

2 participants