From bd10b383bb5ddf94730a0a8de8bfdff680722f43 Mon Sep 17 00:00:00 2001 From: Diego Mello Date: Mon, 25 May 2026 11:27:20 -0300 Subject: [PATCH] fix: don't cancel login saga on 2s timeout (stranded login screen) The cancel in login.js root() fired whichever arm of the race won, so handleLoginSuccess had a hard 2-second deadline. When fetchPermissions or fetchEnterpriseModules ran long, the saga was killed before appStart(ROOT_INSIDE), leaving users on the login screen until they retried. Only cancel when SERVER.SELECT_REQUEST (workspace switch) wins; let the timeout just bound the guard's listening window. Fixes #7333 --- app/sagas/login.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/sagas/login.js b/app/sagas/login.js index d46388d3609..76ebffe604a 100644 --- a/app/sagas/login.js +++ b/app/sagas/login.js @@ -479,11 +479,17 @@ const root = function* root() { while (true) { const params = yield take(types.LOGIN.SUCCESS); const loginSuccessTask = yield fork(handleLoginSuccess, params); - yield race({ + // Only cancel handleLoginSuccess if a workspace switch interrupts it. + // Cancelling on the 2s timeout would rip the saga before it reaches + // appStart(ROOT_INSIDE), stranding users on the login screen when + // permissions/enterprise fetches run long (issue #7333). + const { selectRequest } = yield race({ selectRequest: take(types.SERVER.SELECT_REQUEST), timeout: delay(2000) }); - yield cancel(loginSuccessTask); + if (selectRequest) { + yield cancel(loginSuccessTask); + } } }; export default root;