Skip to content

fix: allow reconnect while auth listener is still active - #4

Merged
AnteWall merged 1 commit into
AnteWall:mainfrom
LurigeLars:fix/upstream-reconnect-after-disconnect
Oct 12, 2026
Merged

AnteWall merged 1 commit into
AnteWall:mainfrom
LurigeLars:fix/upstream-reconnect-after-disconnect

Conversation

@LurigeLars

Copy link
Copy Markdown
Contributor

After a confirmed disconnect, the local listener is intentionally kept alive briefly so the confirmation page can finish rendering. If connect_avanza is called during that grace period, open_browser() reuses the existing listener but previously left the auth state as disconnected.

That meant the browser could reopen, but /start would not begin a new BankID authentication because approval is only accepted while the state is awaiting_approval.

This change:

  • resets retryable terminal states to awaiting_approval when an existing listener is reused
  • clears any stale auth error code
  • adds a regression test covering:
    connected -> confirmed disconnect -> immediate reconnect -> new BankID start

The production change is limited to three lines and does not change session storage, credential handling, or the normal disconnect flow.

@AnteWall
AnteWall merged commit 0824383 into AnteWall:main Oct 12, 2026
2 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