Repository navigation
feat(imports): retry a stopped bank import from Bank connections - #189
Merged
Merged
Conversation
A bank import that fails for a reason the scheduler cannot classify latches its connection, and until now only deleting the latch over SSH could restart it. The connection's card on Bank connections now shows "Import stopped, needs a look" with a "Retry import" button, for the member the connection belongs to or the administrator, only while `bank_sync_runs.retry_reason` reads `blocked`. The press writes `<instance>.retry-requested` (0600) into the consent directory, the one directory both containers share, and records an `import_retry_requested` audit event. The scheduler consumes the marker at its next run: newer than the latch it lifts the latch for exactly one attempt; older it is ignored; with no latch it is simply removed; a marker that is not a plain private file is not believed. A run that fails again latches afresh, so the button is never a retry loop. The page says the retry is queued for the next check, not that it ran. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
A bank import that fails for a reason the scheduler cannot classify latches its connection (
<instance>.blocked,review_required), and until now the only remedy was deleting the latch over SSH (Revolut, 20 October 2026: one HTTP 400, answered normally a day later).bank_sync_runs.retry_reasonreadsblocked, with a Retry import button for the member the connection belongs to or the administrator. After the press the card says the retry is queued for the next check, within thirty minutes, not that it ran. The Monobank card gets the same panel for the member's own Monobank connection.POST /api/connections/retry(CSRF, ownership or admin, 409 unless stopped) writes<instance>.retry-requested(0600, atomic rename) into the consent directory —ENABLEBANKING_SESSION_DIRECTORY, the one directoryappandworkershare — and records animport_retry_requestedrow inaudit_events.GET /api/connectionsnow reportsimportStopped/retryQueuedper approval plus the Monobank connection.src/schedule.tsconsumes the marker at the next run, beside the existing approval-based lift: newer than the latch → latch removed, one attempt; older → ignored; no latch → removed; not a plain private file → not believed. A failed attempt latches afresh, newer than any marker, so the button cannot become a loop.No deployment change: both containers already mount the consent directory and set the variable.
Commands run
Screen verified against a scratch server (demo sign-in, consent stub, seeded
blockedruns) at 1280 px and 390 px (pnpm shots /connections): button present only on the stopped connection, the click wroteenablebanking-rodion-revolut.retry-requestedwith mode-rw-------, the card switched to the queued text, and the server loggedimport_retry_requested.Not verified: a real timer run on the server consuming the marker; the first latched bank after the release will show that.
🤖 Generated with Claude Code