Skip to content
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

Make sure that cookies are saved to disk when closing the app #789

Merged
merged 1 commit into from
May 8, 2018

Conversation

yuya-oc
Copy link
Contributor

@yuya-oc yuya-oc commented May 4, 2018

Before submitting, please confirm you've

Please provide the following information:

Summary
Make sure that cookies are saved to disk when closing the app.

Somehow cookies are not immediately saved to disk. Possibly electron/electron#8416 is related.
So I manually called cookies.flushStore() when the app is quitting or the window loses focus. This would cover almost use cases even if application crashed.

Issue link
Original report: https://pre-release.mattermost.com/core/pl/m4s6qfjb5f815x4co388pscrfe

Test Cases

  1. Quit the app.
  2. Remove the application data folder
    • Windows: AppData\Roaming\Mattermost
    • Mac: ~/Library/Application Support/Mattermost
    • Linux: ~/.config/Mattermost
  3. Open the app.
  4. Login to webapp then quit the app soon (Ctrl/Cmd+Q shortcut).
  5. Reopen the app.
  6. You should not be logged out from webapp.

Additional Notes

@yuya-oc yuya-oc force-pushed the persist-cookies branch from aa37cfb to 08611f2 Compare May 4, 2018 15:20
@amyblais
Copy link
Member

amyblais commented May 4, 2018

@yuya-oc What is the testing server for this?

@yuya-oc
Copy link
Contributor Author

yuya-oc commented May 4, 2018

It would be available at https://circleci.com/gh/yuya-oc/desktop/825#artifacts. CircleCI was delaying.

@yuya-oc
Copy link
Contributor Author

yuya-oc commented May 4, 2018

Tested on Ubuntu 16.04. Now login session is persisted.

@amyblais
Copy link
Member

amyblais commented May 4, 2018

@yuya-oc Works well, just one question about the expected: when I remove the application data folder (step 2) and then reopen the app (step 3), all my servers have disappeared and the "Add Server" page shows up when I reopen the app - this is expected?

@amyblais amyblais requested a review from jasonblais May 4, 2018 16:28
Copy link
Contributor

@jasonblais jasonblais left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good for me too

@jasonblais
Copy link
Contributor

@amyblais It is - that folder contains your users config.json file, which contains all the app settings and servers you configured. Since you deleted it, they were all wiped out..

@yuya-oc yuya-oc merged commit ee94457 into mattermost:release-4.1 May 8, 2018
@yuya-oc yuya-oc deleted the persist-cookies branch May 8, 2018 11:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants