fix(mobile): invite join stuck on Connecting — URL scheme mismatch#2726
fix(mobile): invite join stuck on Connecting — URL scheme mismatch#2726alvinjaison wants to merge 1 commit into
Conversation
wesbillman
left a comment
There was a problem hiding this comment.
The underlying fix is needed, but this leaves existing invite-created communities only partially repaired. RelayConfig.wsUrl makes their socket connect correctly and queryRelay now converts to HTTP, but mediaUploadServiceProvider still passes config.baseUrl directly to MediaUploadService. For an already-stored wss://... community, _buildUploadRequest therefore still constructs a wss://.../upload URI for package:http, so uploads remain broken. The new normalization only applies to future invite joins; it does not rewrite the records that triggered #2662. Please either migrate/canonicalize existing stored community URLs, or consistently use config.httpUrl at every HTTP consumer (at minimum mediaUploadServiceProvider; audit the remaining config.baseUrl uses). Add coverage for an existing wss:// community exercising the HTTP endpoint derivation.
Separately, DCO is currently failing because the commit lacks the required sign-off.
972ad5c to
60326b1
Compare
…e invite deep-link parser produces wss:// relay URLs, but RelayConfig.wsUrl assumed baseUrl was always HTTP-scheme (https/http). When baseUrl was wss://, the getter incorrectly downgraded it to ws://, causing the WebSocket connection to a TLS-only hosted relay to hang indefinitely with no timeout. Fix: - RelayConfig.wsUrl: handle wss/ws schemes directly (pass through) instead of only recognizing https → wss. - Add RelayConfig.httpUrl getter for REST endpoints (/query, /upload) that correctly converts wss → https, ws → http. - Update queryRelay, relayClientProvider, mediaUploadServiceProvider, and mediaGetAuthServiceProvider to use httpUrl for HTTP calls instead of raw baseUrl. - Normalize relay URL at storage time in InviteJoinNotifier.confirmJoin (wss → https, ws → http) so Community.relayUrl matches the pairing flow's HTTP-scheme convention. - Add migration in CommunityStorage.loadAll() that canonicalizes existing stored wss://ws:// community URLs to https://http:// on first load, repairing communities created before this fix. Closes block#2662 Signed-off-by: Alvin Jaison <alvinjaison@outlook.com> Signed-off-by: Alvin Jaison <alvinjaison@outlook.com>
60326b1 to
1b4872a
Compare
|
@wesbillman Addressed your feedback in the force-push:
48 tests pass, |
Summary
Fixes the iOS invite join flow getting permanently stuck on "Connecting…" when opening a hosted-community invite link.
Root Cause
The invite deep-link parser produces
wss://relay URLs (correct for the WebSocket scheme). These are stored directly asCommunity.relayUrl. However,RelayConfig.wsUrlassumedbaseUrlwas always HTTP-scheme:When
baseUrlwaswss://, this incorrectly downgraded it tows://(plaintext). A hosted relay at*.communities.buzz.xyzonly accepts TLS connections, so thews://connect attempt hangs forever — no timeout onWebSocketChannel.connect.The pairing flow works because it validates and stores URLs as
https://, which the old getter handled correctly.Fix
RelayConfig.wsUrl— switch expression that passeswss/wsthrough unchanged and convertshttps→wss,http→ws.RelayConfig.httpUrl(new) — inverse getter for REST endpoints. Convertswss→https,ws→http.queryRelay+relayClientProvider— usehttpUrlinstead of rawbaseUrlfor HTTP calls (media upload,/querybridge).InviteJoinNotifier.confirmJoin— normalize URL at storage time (wss→https,ws→http) soCommunity.relayUrlmatches the pairing convention.Testing
RelayConfig.wsUrl/httpUrlscheme handlingflutter analyze— no issuesdart format— no changes neededCloses #2662