-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix MM-61975 #8459
Fix MM-61975 #8459
Conversation
app/managers/session_manager.ts
Outdated
@@ -187,7 +187,7 @@ class SessionManager { | |||
|
|||
private onSessionExpired = async (serverUrl: string) => { | |||
this.terminatingSessionUrl.add(serverUrl); | |||
await logout(serverUrl, false, false, true); | |||
await logout(serverUrl, undefined, true, false, true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm unsure why we call this, we changed skipServerLogout
to true and skipEvents
is true. We won't do anything in logout apart from return {data: true};
? Unless changing skipServerLogout
to true was a mistake?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are completely right. But it makes kind of sense 😅
If the session expired, in theory it expired on the server, so we don't need to contact the server.
And if we are in this part of the code, is because the SESSION_EXPIRED event was triggered, so we don't have to trigger it again.
I guess we can remove the logout completely, yes, but I have mixed feelings because "logically" it makes sense to have it here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I guess this call is here in case there are changes to the logout function in future and we forget to add the call back to onSessionExpired
? Should we add a comment above this call in case someone else removes it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me
@rahimrahman @jupenur Friendly reminder to review this |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One small nit, but all good.
app/actions/remote/session.ts
Outdated
|
||
const body = logoutOnAlert ? | ||
intl?.formatMessage({id: 'logout.fail.message.forced', defaultMessage: 'We could not log you out of the server. Data may continue to be accessible to this device once the device goes back online.'}) || 'We could not log you out of the server. Data may continue to be accessible to this device once the device goes back online.' : | ||
intl?.formatMessage({id: 'logout.fail.message', defaultMessage: 'We could not log you out of the server. If you log out now, data may continue to be accessible to this device once the device goes back online. Do you still want to continue?'}) || 'We could not log you out of the server. If you log out now, data may continue to be accessible to this device once the device goes back online. Do you still want to continue?'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: could potentially add to a variable so that you don't have to repeat twice?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Verified if the server is not reachable. We will see the alert when trying to log out.
- Verified if the loggin out is cancelled. When server connection is established, we use the app
- Verified Logging out of multiple server when device is offline.
"logout.fail.cancel": "Cancel", | ||
"logout.fail.continue_anyway": "Continue Anyway", | ||
"logout.fail.message": "You’re not fully logged out. Some data may continue to be accessible to this device once the device goes back online. What do you want to do?", | ||
"logout.fail.message.forced": "We could not log you out of the server. Some data may continue to be accessible to this device once the device goes back online.", | ||
"logout.fail.ok": "OK", | ||
"logout.fail.title": "Logout not complete", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cwarnermm I updated the texts. Let me know if I missed anything (apart of the retry button)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you!!
@abhijit-singh Any opinion on adding a retry button? My concern is that it will clutter the alert with too many buttons and too many options. But 0/5. |
@larkox Agreed. I'd hold back on adding a retry button right now. This is an improvement already. |
@jupenur I re-requested your review since it was not yet approved, and for a final check before merging. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. And Copilot also says it's great 🤖 #tryAI
/cherry-pick release-2.25 |
Cherry pick is scheduled. |
/cherry-pick release-2.26 |
Cherry pick is scheduled. |
Error trying doing the automated Cherry picking. Please do this manually
|
* Fix MM-61975 * Add missing strings * Ensure the app gets logged out after not accepting the ToS * Fix i18n and add comment * Fix tests and address feedback * Check for the right value coming from status * Update texts (cherry picked from commit 779fe31)
* Fix MM-61975 * Add missing strings * Ensure the app gets logged out after not accepting the ToS * Fix i18n and add comment * Fix tests and address feedback * Check for the right value coming from status * Update texts (cherry picked from commit 779fe31) Co-authored-by: Daniel Espino García <larkox@gmail.com>
* Fix MM-61975 * Add missing strings * Ensure the app gets logged out after not accepting the ToS * Fix i18n and add comment * Fix tests and address feedback * Check for the right value coming from status * Update texts
* Fix MM-61975 * Add missing strings * Ensure the app gets logged out after not accepting the ToS * Fix i18n and add comment * Fix tests and address feedback * Check for the right value coming from status * Update texts
Summary
Fix MM-61975
Ticket Link
Fix https://mattermost.atlassian.net/browse/MM-61975
Release Note