Fix Disconnect and saves in Bank sync connection rows
Problem
Each row under Your connections on Bank sync rendered its provider panel inside <turbo-frame id="<key>-providers-panel"> with no target. Every form and link in the panel was therefore a frame request.
- Disconnect showed "Content missing".
- Mercury, Brex and Wise redirect
destroyto Accounts. Kraken, CoinSpot and others redirect to Bank sync, which has no row once the last connection goes. - Neither response contains the frame, so the row broke and no flash appeared. The item was still unlinked and scheduled for deletion.
- Links to Accounts, SnapTrade's OAuth link and Wise's profile step failed the same way.
- Mercury, Brex and Wise redirect
- The second save left the row (Codex on #3834).
- 15 panel roots share the frame's
<key>-providers-panelid. turbo_stream.replaceresolves that id withgetElementById, which returned the frame. The first save therefore swapped the frame for the bare panel.- The next save was no longer a frame request. For Mercury, Brex, IBKR, Trading 212, Lunch Flow, Wise and Sophtron, that fallback redirected to Accounts. For the other panels it reloaded Bank sync, and the morph refresh collapsed the open row.
- 15 panel roots share the frame's
The drawer's frame has target="_top", so its forms already post from the page and take that fallback. The fallback was broken in eight controllers.
Change
Seven commits. The first three fix the rows. The last four are follow-ups: one shared helper for the panel renders, the generator's Bank sync wiring, SimpleFIN's errors, and Sync inside an open row.
Keep page-level provider panel saves on the Bank sync page
- Silent errors. Akahu, Coinbase, CoinStats, Enable Banking and Indexa Capital redirected errors with a 422. fetch doesn't follow a 422
Locationand the body is empty, so Turbo showed nothing.- They now use a 303, as the other panels do, so the alert shows.
- The provider generator's controller template had the same line and gets the same fix.
- 500s. Mercury (create, update), Lunch Flow (update) and Sophtron rendered
new/edittemplates that don't exist.- They now redirect back with the alert.
- Lunch Flow's update mirrors the fix its create got in #2724.
- Sophtron's error helper drops the
view_nameit only used to pick the template.
- Updates left the page. Updating a Mercury, Brex, IBKR, Trading 212, Lunch Flow or Wise connection, or generating Wise's SCA key, redirected to Accounts.
- When Turbo asks for a stream, these now re-render their panel in place.
- They use Trade Republic's
turbo_panel_request?(turbo_frame_request? || request.format.turbo_stream?), moved toApplicationController. - Wise and Brex share their error helper with create, so a failed connect in the drawer now shows its error in the drawer.
- A successful Brex create still moves on to Accounts.
- Lunch Flow's panel root gets the id its stream replaces.
Render connection row panels without a frame of their own
- The panel renders straight into the row, so its forms post from the page, as the drawer's do.
- Nothing else on the page is a frame, so a
target="_top"frame would do nothing. - Rows get a
<key>-connectionid for tests.
- Nothing else on the page is a frame, so a
- Enable Banking's panel root gets
enable_banking-providers-panel.EnableBankingItem::SyncCompleteEventbroadcasts a replace of that id, and only the frame carried it.
Keep the remaining provider panel saves in place on Bank sync
- Every panel keeps its saves and errors in place.
- Akahu, CoinSpot, CoinStats, Enable Banking, Fio, Indexa Capital, Kraken, Monobank, On-chain, Questrade, Redbark, Up and Sophtron: updates, and create or update errors, now answer
turbo_panel_request?and replace the panel root. - The create errors for Mercury, IBKR, Trading 212, Lunch Flow, Coinbase and Binance do the same, so a failed connect keeps the drawer open with its error.
- Akahu, CoinSpot, CoinStats, Enable Banking, Fio, Indexa Capital, Kraken, Monobank, On-chain, Questrade, Redbark, Up and Sophtron: updates, and create or update errors, now answer
- A successful create still reloads, which moves the new connection under Your connections. Where create shared its success helper with update, it now redirects directly.
- Dead branches removed.
- No panel create or update path checks
turbo_frame_request?any more, since nothing sends the header to them. The checks that remain are in modal flows, which do send it. - Binance and Coinbase have no edit form, so their
updatejust redirects.
- No panel create or update path checks
- Panel roots.
- CoinStats, Indexa Capital, Questrade, Sophtron and Binance get the root id their streams target.
- CoinSpot, Kraken and On-chain
replacetheir panel instead ofupdate, which nested a second copy inside it.
- Generator.
rails g provider:familyadds aFAMILY_PANELSentry instead of injecting asettings_sectionwith a frame intoshow.html.erb.- It drops the reject condition that
FAMILY_PANEL_KEYSalready covers. - Its controller and panel templates follow the rules above.
- The guide lists what a generated provider still needs to show under Your connections: a
provider_summarycase and the sync-health entries.
- Redundant targets. Questrade's Disconnect and the Wallet account link drop a
data-turbo-frame="_top"that no frame needs. - Tests. The PR's panel tests use
as: :turbo_streamandassert_turbo_stream.
Render provider panel saves through one shared helper
ApplicationController#render_provider_panel(key, notice:, alert:, fallback_path:, **locals)replaces the hand-written replace-or-redirect in all 22 panel controllers and in the generator's controller template.- It finds the panel's
turbo_idand partial through itsFAMILY_PANELSkey, which covers Trade Republic'strade-republicid. - An alert renders in the panel with a 422. A notice goes to the flash.
- It finds the panel's
- The per-controller helpers are gone. That includes a private
render_provider_panel(flash_type, …)in Akahu, Up, Monobank and Fio, which would have shadowed the shared one. Wise keeps two one-line wrappers. - Locals that the panels never read, or that repeat their own default query, are dropped. CoinSpot's panel gets the default query Kraken's has.
- The update notices lose English
default:s that contradicteden.yml. - Two fallbacks change:
- Lunch Flow's non-Turbo errors now go to Bank sync directly. They redirected back, which lands on Bank sync whenever the browser sends a Referer.
- Questrade's error redirects are 303s.
List a generated family provider under Your connections
rails g provider:familynow also adds the provider'sprovider_summarycase and itsPANEL_SYNCABLE_TYPESandfamily_panel_itemsentries. A connected provider then moves under Your connections, with a sync status and a working Sync button.- The guide and the generator's "Next steps" no longer list these as manual edits.
Show SimpleFIN's connection errors where the form was
- The panel form sends
source=panel, and its errors replace the panel, which now carriessimplefin-providers-panel. - The new-connection modal sends the same Turbo request without the marker, so it still renders
newwith its error. - The edit modal showed no error at all. Its frame request got a stream aimed at a panel that the Accounts page doesn't have. It now gets the
edittemplate.
Keep the open connection row open after its panel's Sync
- 15 panels have a Sync button inside the open row. Their sync actions redirected back to Bank sync, and the morph refresh collapsed the row.
- The panel buttons now send
source=paneland re-render the panel in place with a "Sync started." toast. Trade Republic replaces only its card, as its login steps do. - The Accounts page's Sync buttons post to the same actions without the marker, and still redirect back.
- Enable Banking's Sync drops
data-turbo=false, which it had copied from Reconnect.
Screenshots
Disconnect from a connection row, before (left) and after (right). Before, the row shows "Content missing" and no flash. After, the page follows the redirect to Accounts and shows the flash.

The rows themselves look the same, so the other changes only show after a click:
| Before | After | |
|---|---|---|
| Disconnect | "Content missing" in the row, no flash | Lands on its redirect target with the flash |
| Second save | Lands on Accounts, or reloads Bank sync and closes the row | Stays open in the row |
| Failed connect in the drawer | Nothing happens, or the drawer closes with an alert | The error shows in the drawer |
| Sync inside an open row | Reloads Bank sync and closes the row | Stays open, with a "Sync started." toast |
| Bad SimpleFIN token in the row | Replaces Bank sync with the new-connection modal page | The error shows in the panel |
Disconnect, the second save and Sync are system tests. Controller tests cover the drawer error (see Validation).
Validation
- System tests (
test/system/settings/providers_test.rb). Each fails on main's code:- Disconnect from the Mercury row lands on Accounts with the success flash.
- Two saves from the Mercury row both stay on Bank sync. The second fails on main exactly as Codex described:
expected "/accounts" to equal "/settings/providers". - Sync from the open Mercury row keeps the row open. With the old behaviour, every row collapses and no toast shows.
- Controller tests, all red first:
- 12 page-level error paths (422 or
MissingTemplate). - In-place saves for the six providers and Wise's SCA key. The stream carries both the target and the root id, so a second save still finds it.
- Rows contain no frame, and every
-providers-panelid appears once. - Every streamed panel renders the root its streams and the Enable Banking broadcast replace (checked through the drawer for all of them).
- Third commit: in-place saves for the 13 panels above; in-place create or update errors in 19 controllers; and creates that still redirect where they shared a helper with update.
- Generator: the controller template renders valid Ruby with no
turbo_frame_request?. TheFAMILY_PANELSinsertion works against the real controller. Both were red against the old generator. - Follow-ups, red first:
- Panel Sync for all 15 panels.
- SimpleFIN's panel error and its edit-modal error.
- The three new generator insertions, run against the real helper and controller.
- Guards that stayed green: Sync from the Accounts page still redirects back where no test covered it, and SimpleFIN's new modal still renders
new.
- 12 page-level error paths (422 or
- Audit. Every control in the 25 panels was checked as a page-level submission. It found nothing beyond what this PR fixes.
bin/rails test: 10,261 runs, 0 failures, 0 errors, 33 skips.bin/rails test:systemfor the first three commits: 171 runs, 0 failures, 1 error. The error is the date-dependentRecordNotFoundindeclare_and_pay_bill_test.rb, which fails on main too. For the follow-ups I ran the providers, on-chain wallet, accounts, sync UI and settings system tests: 39 runs, 0 failures.- RuboCop, erb_lint, Biome and Brakeman are clean.
git merge-treeagainst the 24 open PRs that touch these files finds these new conflicts:- #2906 (last updated 2026-09-12), in
enable_banking_items_controller_test.rb. Every spot in that 66-line file overlaps a hunk from one of five open PRs. - #3548: both PRs add
test/controllers/up_items_controller_test.rb. - #3511 and #3512: the CoinSpot and Fio controllers and their tests.
- #3821:
redbark_items_controller.rb. - #1832 (last updated 2026-09-12):
sophtron_items_controller.rb.
- #2906 (last updated 2026-09-12), in
git merge-treefor the follow-ups finds these new conflicts:
Summary by CodeRabbit
- Bug Fixes
- Failed provider connection submissions now show validation alerts in the provider panel or return users to provider settings, depending on how they submitted the form.
- Provider updates refresh the panel and display success or validation feedback.
- Updates
- Syncs started from provider panels now show an in-progress notice while keeping users on the page.
- After creating a connection, users are redirected to the relevant settings or Accounts page.