DROID-77263: fix empty-login boot-loop panic in dummybridge#10
Conversation
An empty username persisted a UserLogin with ID=="". With split portals enabled, the empty receiver makes GetPortalByKey fail on every startup. Substitute a random ID for empty usernames so the login ID can never be empty, while keeping the form's "anything goes" contract. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
A bare panic(err) in the portal-generation goroutine turned any persistent error into a boot-loop crash of the host app. Report an UNKNOWN_ERROR bridge state and return instead, so a bad login can never crash the host. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📜 Recent review details⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
🔇 Additional comments (3)
📝 WalkthroughSummary by CodeRabbit
WalkthroughTwo defensive fixes in the dummy connector: ChangesDummy Connector Defensive Fixes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
|
Summary
Fixes a host-app boot-loop crash (DROID-77263) caused by logging into dummybridge with an empty username.
An empty username persisted a
UserLoginwithID == "". With split portals enabled (Beeper SDK local bridges), the portal-generation goroutine inDummyClient.Connectbuilt aPortalKey{Receiver: ""}, andBridge.GetPortalByKeyrejected it withreceiver must always be set when split portals is enabled. The goroutine's barepanic(err)then crashed the whole SDK process — and the host Android app — on every startup, since the bad login row persists.This is the approved two-layer fix ("do changes 1+2 only"):
pkg/connector/login.go: never persist an empty login ID. The login form advertises "anything goes and it's used as the ID", so an empty username is preserved by substituting a random ID rather than being rejected. This prevents an empty receiver at the source.pkg/connector/client.go: replace the barepanic(err)in theConnectgoroutine with a logged error plus anUNKNOWN_ERRORbridge-state report, thenreturn. Defense in depth — a bad/persistent login error can never crash the host app, including any pre-existingID == ""logins already in the database.Testing
go build ./pkg/connector/...passes;go vetandgofmtclean.Out of scope
Recovery of already-broken installs / upstream mautrix-go empty-ID validation (Change 3 in the triage plan) is intentionally not included, per the autofix directive.
Linear: https://linear.app/beeper/issue/DROID-77263
🤖 Generated with Claude Code