Repository navigation
chore: Merge 4.77.1 into master - #7779
Conversation
(cherry picked from commit 8e769ae)
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (63)
🚧 Files skipped from review as they are similar to previous changes (17)
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review. 📜 Recent review details⏰ Context from checks skipped due to timeout. (2)
🔇 Additional comments (38)
WalkthroughThe update scopes Basic Auth to workspace origins and adds cancellation to server probing. It adds consent prompts for tokenless deep links to unknown servers, updates attachment URL formatting and room grouping, and changes app and platform version metadata to 4.77.1. ChangesWorkspace Authentication and Server Probing
Attachment URL Handling
Deep-Link Consent and Call Cleanup
Categories Display Grouping
New Server Navigation
Version Update
Priority: ➖ Normal Estimated code review effort: 4 (Complex) | ~45 minutes Change: Other Sequence Diagram(s)sequenceDiagram
participant SelectServerSaga
participant ServerInfo
participant LoginServices
participant LoginSettings
SelectServerSaga->>ServerInfo: Probe with abort signal
SelectServerSaga->>LoginServices: Load services with abort signal
SelectServerSaga->>LoginSettings: Load settings with abort signal
SelectServerSaga->>SelectServerSaga: Abort probe on timeout or completion
Suggested labels: Suggested reviewers: Merge Risk: ⚪ Minimal · up to The reported test failure does not occur, and declining the call-push prompt does not leave a native VoIP call active. The change is mergeable after normal checks. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 8 functions across 42 files. (25 skipped: 25 unsupported.)
Warning Errors were encountered while retrieving linked issues. Errors (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Android Build Available Rocket.Chat 4.77.1.109912 Internal App Sharing: https://play.google.com/apps/test/RQQ8k09hlnQ/ahAO29uNQlBBbgvTi7b73KmTNp979PrHJP4bNCsIrYH2RqyV4ZZz9ULu_cu0viHFosVh-EdOkywj-n0Qlr6E11soDZ |
|
iOS Build Available Rocket.Chat 4.77.1.109913 |
* fix: scope getServerInfo request headers to known servers Only attach the stored auth headers when the user is already signed in to the requested server, and add tests. * fix: only send auth headers in getServerInfo to servers the user is signed in to Drops the Basic auth handling and skipCustomHeaders option from the previous commit and reverts fetch.ts to develop. * remove comment * coderabbit suggestion * fix: address review comments for deep-link consent and getServerInfo - extract getSessionHeaders to fix oxlint complexity - move getServerInfo test to __tests__ folder - prompt before first request to new deep-link host * fix: scope Basic Authorization to requested server in getServerInfo Load Basic auth only for the requested host and skip global customHeaders so deep links to unknown hosts no longer receive the active workspace credentials. * refactor: pass serverRecord to ensureDeepLinkLoginConsent and cover the known-host branch The callers already hold serverRecord, so the consent check no longer re-reads MMKV and the database. The known-host test now uses a server record without a signed-in user so it reaches the new branch. * fix: scope Basic Authorization on the cloud lookup and add-server requests getUniqueId and the add-server requests (getLoginServices, getLoginSettings) still merged the global custom headers, so the current workspace's Basic Authorization reached the requested host after the scoped /api/info call. getUniqueId now sends only the requested server's stored Basic auth, and handleServerRequest points the global Basic auth at the requested server before making any request. * fix: keep Basic auth and session headers scoped to the right server - restore the active workspace's Basic auth when the add-workspace flow is closed - stop sending the global Basic auth to the releases.rocket.chat lookup - require the stored token, not only the user id, before sending session headers - cover the call-push consent branches * fix: end the VoIP call when the sign-in prompt is declined * test: restore customHeaders after each fetch test and drop redundant skipCustomHeaders assertions * revert: move applyBasicAuth handling in selectServer out of this PR * Revert "revert: move applyBasicAuth handling in selectServer out of this PR" This reverts commit 48a3f45. * revert: drop VoIP call cleanup on declined deep-link consent Reverts 924bbf7. The extra handleVoipAcceptFailed call on the decline branch is not part of the credential-leak fix this PR is about. * fix: restore the active workspace's Basic auth when the add-workspace flow finishes Re-apply the connected workspace's stored Basic auth on FINISH_ADD so a failed probe can't leave the probed host's header on later requests. * fix: restore the active workspace's Basic auth as soon as the add-workspace probe ends handleServerRequest swaps the global Basic auth to the probed host and only handed it back on FINISH_ADD, so a failed connect left the active workspace's requests carrying the wrong Authorization until the form unmounted. Restore it in a finally block instead and drop the FINISH_ADD watcher, which keyed off sdk.host before the new connection existed. * fix: address review comments on scoped probe auth and deep-link consent - Guard hardware back while the add-workspace check runs so the active workspace Basic auth can't leak to the probed host - Drop the redundant global Basic auth write in NewServerView - Let fetch callers' headers win over global custom headers and add the getBasicAuthKey helper - Send per-request Basic auth in getLoginServices/getLoginSettings and scope the global swap in getWebsocketInfo to the handshake only, so the probe no longer touches the shared headers - Thread the requested server version through the cloud unique-id lookup - Neutral deep-link consent copy for tokenless links * chore(i18n): add Deep_link_open_* strings for tokenless deep-link consent * refactor: simplify scoped Basic auth handling and share stored-session lookup - keep the add-workspace websocket handshake swap inline in getWebsocketInfo - read the stored user id and token through getStoredSession everywhere - select the deep-link consent copy from a table instead of repeated ternaries - only swallow hardware back while connecting when there is a workspace to return to - remove explanatory comments from tests * refactor: fold add-workspace back guard into handleBackPress * test: cover the add-workspace hardware back guard in NewServerView * fix: restore the active workspace headers before the add-workspace handshake settles * fix: scope the auto-lock time sync request to the requested server's Basic auth * refactor: share applyBasicAuth and finish the deep-link consent rename * fix: end the VoIP call when the deep-link open prompt is declined Also rename shouldAutoConfirmDeepLinkLogin to shouldAutoConfirmDeepLinkConsent now that it gates both prompts. * test: seed a stale header in the reselect test and use ~/ imports in the new tests * fix: skip the DM navigation when the deep-link open prompt is declined after a failed VoIP accept Declining the prompt only needs to end the call and reset the VoIP state. Running the full failed-accept handler also tried to open a DM with the caller on the active workspace, which is not the host the user declined. * fix: send Basic auth to the iframe SSO endpoint only on the server's own origin The iframe login fetch went through the shared headers, so it carried the active workspace's Basic Authorization to whatever host Accounts_Iframe_api_url points at. It now sends the stored Basic auth only when the URL has the same origin as the server. * test: drop dead active-server setup from the probeAuth tests * refactor: restore isLoggedInServer to read only the user id * test: use ~/ imports for collaborators in getServerInfo and getLoginSettings tests * test: move logout test into __tests__ and use ~/ paths in jest.mock calls * test: use fake timers in getServerTimeSync tests to stop leaking the race timeout * test path fix * test: drive the probe handshake through the real SDK so header timing is pinned at WebSocket construction * refactor: rename getBasicAuthHeader module to serverBasicAuth * fix: send /api/info the requested server's own stored session * refactor: read the stored session through getStoredSession in removeServer test: cover the back handler when connecting flips after mount * fix: send each page of the public settings fetch the requested server's own Basic auth * refactor: address review feedback on basic auth and deep-link consent helpers Drop the unreachable early-return applyBasicAuth and its test, fold setBasicAuth into applyBasicAuth, rename the probe test array, and pass isKnownHost to ensureDeepLinkConsent. * fix: time out the add-workspace probe when the host never answers Race the probe against a 30s timer so a host that accepts the connection and never responds can't leave the user stuck on Add workspace, and show a dedicated Connection_timed_out message. * fix: abort the add-workspace probe requests when it times out or is superseded A probe that timed out kept its settings and login-services requests running, so a late reply could overwrite the active workspace's settings. The probe now shares one abort signal across its requests and closes the websocket probe on abort. * using workspace instead of server * some more changes * refactor: share the workspace basic auth helpers and abort the whole add-workspace probe Every per-workspace request now goes through fetchForWorkspace, and the websocket handshake header swap through withBasicAuth, both in serverBasicAuth, so a call site can no longer forget to scope the Basic auth. The probe's abort signal now also reaches the /api/info, unique-id and supported-versions requests; an abort that comes from that signal leaves the store alone instead of failing the active workspace's connection. The NewServerView back handler is back to plain functions with explicit effect deps, the getLoginSettings tests live in getSettings.test.ts, and the fetch spy shared by the basic auth tests is testUtils/mockGlobalFetch. * refactor: drop unrequested renames in logout test and deep-link auto-confirm helper * fix: send the shared Basic auth only to the workspace origin fetch attaches the shared Authorization only to the origin applyBasicAuth recorded it for, and fetchForWorkspace sends the stored Basic auth only to the server's own origin. This replaces the per-call Authorization overrides on the supported-versions lookup and the iframe SSO request, and moves the origin comparison into isSameOrigin next to getOrigin. * refactor: restore the inline session read in removeServer Logout is left for a follow-up, so removeServer reads the stored user id and token the way it did before. * refactor: let the deep-link callers decide whether consent is needed Drops the isKnownHost flag from ensureDeepLinkConsent. handleOpenDifferentServer and handleClickCallPush now skip the prompt for known hosts without a token. * test: move the logout test into __tests__ Uses ~/ paths in the jest.mock calls. * refactor: share the deep-link consent predicate between both callers handleOpenDifferentServer and handleClickCallPush repeated the same "token or unknown host" condition, which pushed handleClickCallPush over the cognitive complexity limit. Name it once as requiresDeepLinkConsent. * refactor: keep the add-workspace probe result typed through the timeout race
|
Android Build Available Rocket.Chat 4.77.1.109941 Internal App Sharing: https://play.google.com/apps/test/RQQ8k09hlnQ/ahAO29uNRXsuxS8L3K4MfWi_Xn-D6VKryyGQ1dsx8Ms5_0OkPJGVVb3fsqDsE7e9IMDOIZ2W4KSWTgGvO4l9gt-rUl |
|
iOS Build Available Rocket.Chat 4.77.1.109944 |
|
Android Build Available Rocket.Chat 4.77.1.109941 |
Proposed changes
Patch release 4.77.1: the 4.77.0 release plus these fixes, cherry-picked from
develop:rc_token/rc_uid) only when it is on the workspace's origin.#7766, #7754 and #7780 applied with no conflicts. #7755 conflicted in
app/lib/methods/helpers/fetch.tsand its test, because the React Native 0.86 upgrade changed that file ondevelopand is not part of this release. The resolvedfetch.tsis identical todevelop.The version is bumped to 4.77.1 in
package.json,android/app/build.gradle, both iOSInfo.plistfiles (app and share extension), and bothMARKETING_VERSIONentries in the Xcode project.Issue(s)
https://rocketchat.atlassian.net/browse/NATIVE-1736
How to test or reproduce
Categories (#7766):
Attachment credentials (#7754):
chat.sendMessageendpoint).rc_token/rc_uid.iOS file preview (#7780):
Auth headers (#7755):
rocketchat://room?host=http%3A%2F%2Flocalhost%3A8000&path=channel%2Fgeneral, with a local listener logging request headers./api/infoarrives withoutX-Auth-TokenandX-User-Id.Authorizationheader reaches the other host.Authorizationheader from the current server.Version:
Screenshots
Types of changes
Checklist
Further comments
As a patch, 4.77.1 does not flow through
develop; all four fixes are already there.Summary by CodeRabbit