feat(trade-republic): add connections from the panel and create them only once approved #4265
All Vouch review confidence checks passed
Residual risk 0.33 = Change Risk (0.59) × (1 − Review Confidence (0.45)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.59 · 650 lines diff across 8 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.388
Shallow Review Depth
shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #4265"
general
weight: 0.35
nielseulink
Problem
TradeRepublicItembefore Trade Republic approved the login. A cancelled or abandoned QR login left a connection behind, and "Add another connection" appeared before the first one existed.Behavior after this PR
TradeRepublicPendingConnection, which holds the pending login state and device ID and becomes aTradeRepublicItemwhen Trade Republic approves it. Cancelling removes it. A lapsed QR login counts as expired, so it no longer blocks adding a connection. The QR, push and authenticator steps move intoTradeRepublicLoginFlow, shared with an existing connection that logs in again.FOR NO KEY UPDATElock on the family. That lock does not conflict with theKEY SHARElock an approval takes for the family foreign key, so a start and an approval cannot deadlock.initiate_loginaction goes. Nothing posts toTradeRepublicItemsController#initiate_loginsince the rows have no Log in button, and it could not log in anyway because the PIN is never stored. Its route, its tests and translations nothing uses are removed.providers.metasection yet, so theirlogin_requiredandlogin_expires_soonfall back to English, as their otherproviders.metakeys already do. Trade Republic product names (Brokerage, Private Markets, Crypto Wallet, Saveback, Round up) stay untranslated, as in the Trade Republic app; Dutch uses the app's own "Vaste Rente".DS::Cardgets aninsetvariant and atagoption, used for the QR code and both PIN forms instead of the same panel built by hand three times. No new styles.Screenshots
| Before | After |
|---|---|
| Connections in Settings: each with its own phone number and PIN form, plus a form to add another | Connections as rows; Add a connection with QR login and PIN login |
| <img width="767" height="1293" alt="image" src="https://github.com/user-attachments/assets/166810f4-a11f-402f-aa8c-8573f1eca833" /> | <img width="767" height="425" alt="image" src="https://github.com/user-attachments/assets/119bb898-6778-4e93-8231-0c57dbe72579" />|
| QR login on a connection, above its PIN form | QR login on a connection; its PIN login is hidden meanwhile |
| <img width="767" height="1603" alt="image" src="https://github.com/user-attachments/assets/eb994205-194b-4751-9deb-88679150c9f0" /> | <img width="767" height="731" alt="image" src="https://github.com/user-attachments/assets/3de50d4a-2253-45ab-9414-ad1d414292fb" /> |
| (the PIN form was always shown, see above) | PIN login opened inline below the row |
| See above | <img width="767" height="619" alt="image" src="https://github.com/user-attachments/assets/0e69f32d-1e4f-40b2-b568-28e43164e146" /> |
Migration notes
20261015170000_create_trade_republic_pending_connectionscreatestrade_republic_pending_connections(family_idwith a unique index and foreign key,phone_number,pending_login_state,currency,device_idwith defaultgen_random_uuid()). It is a new, empty table; existing connections are not touched.TradeRepublicItemwaiting for approval) keeps working as an existing connection and can log in again from its row.Validation
bin/rails testona5b6f98f4: 12,295 runs, 3 failures and 3 errors, inSettings::HostingsControllerTest,Eval::Langfuse::ExperimentRunnerTestandSimplefinEntry::ProcessorTest. These fail the same way onmainin my environment and are unrelated to Trade Republic.test/system/trade_republic_new_connection_test.rb,test/system/trade_republic_qr_login_test.rb,test/system/settings/providers_test.rb,test/system/settings_test.rb,test/system/onchain_wallets_test.rbandtest/system/replace_url_back_test.rb: 49 runs, all pass.bin/rubocop,bundle exec erb_lint --lint-all,npm run lintandbin/brakemanpass.Council review
Rounds: 6
| Delegate | Round 1 | Round 2 | Round 3 | Round 4 | Round 5 | Round 6 |
| --- | --- | --- | --- | --- | --- | --- |
| Claude Opus 5.5 | 8.5/10 | 9/10 | 9/10 | 9.5/10 | 9.5/10 | 9.5/10 |
| GPT-6.1 Sol | 9/10 | 9/10 | 8.5/10 | 8.5/10 | 9.5/10 | 9.5/10 |
| Grok 4.7 | 7/10 | 8/10 | – | – | – | – |
| Claude Sonnet 5.5 | – | – | 9/10 | 9.5/10 | 9.5/10 | 9.5/10 |
Sonnet 5.5 replaced Grok from round 3. Resulting changes: a non-admin authorization test, one shared
lapsed?rule, and QR cancels that are no longer sent without a login token after a failed, superseded or unreadable start. Round 6 covered the encryption backfill entry, the untranslated product names, removing pending logins in a financial data reset, and the locale merges withmain; no findings.<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
Summary by CodeRabbit
New Features
Set up Trade Republic connections using QR or phone-and-PIN login, with authenticator-code entry and approval prompts.
Connection cards show login, sync, and session-expiry status, with controls to manage multiple connections.
Sessions nearing expiry can trigger a sync before they expire.
Added translated connection and login guidance across supported languages.
Provider status warns when login is required or a session is nearing expiry.
Bug Fixes
Expired sessions are identified as requiring login and excluded from syncing.
* QR login errors remain cancellable, and blank phone-number submissions no longer overwrite a saved number.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->