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

Option to clear all the cache, cookies and localstorage. #60

Closed
engelgabriel opened this issue Dec 3, 2015 · 5 comments · Fixed by #516
Closed

Option to clear all the cache, cookies and localstorage. #60

engelgabriel opened this issue Dec 3, 2015 · 5 comments · Fixed by #516
Assignees
Milestone

Comments

@engelgabriel
Copy link
Member

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@popiolek
Copy link

popiolek commented Dec 4, 2015

As quick fix before some real fix, I've created simple batch script that deletes cookies and local storage files before starting app. Maybe someone will find it helpful:

@echo off

:: Set Rocket.Chat path here (path to exe file)
set chat="%ProgramFiles(x86)%\Rocket.Chat\Rocket.Chat.exe"
:: Files to delete
:: GitLab login is stored in cookies
set file[0]=%USERPROFILE%\AppData\Roaming\Rocket.Chat\Cookies
set file[1]=%USERPROFILE%\AppData\Roaming\Rocket.Chat\Cookies-journal
:: Rocket.Chat login is stored in local storage
set file[2]=%USERPROFILE%\AppData\Roaming\Rocket.Chat\Local Storage\https_yourdomain.com_0.localstorage
set file[3]=%USERPROFILE%\AppData\Roaming\Rocket.Chat\Local Storage\https_yourdomain.com_0.localstorage-journal

:: For each file
for /F "tokens=2 delims==" %%s in ('set file[') do (
    :: If sosmething already was marked then delete
    if exist "%%s.toDelete" del "%%s.toDelete"
    :: Check if file is locked if not mark to delete
    if exist "%%s" move "%%s" "%%s.toDelete" || goto onerror
    :: Delete marked file
    if exist "%%s.toDelete" del "%%s.toDelete"
)

:: Run Rocket.Chat app and finish script
start "" %chat%
exit

:onerror
:: Show error message (should work for most systems)
mshta javascript:alert("Files are locked.\n\nCheck if there is no Rocket.Chat running in the backgroud.");close();

You need to provide your domain in there https_yourdomain.com_0.localstorage, and any path if it differ. Sorry for code quality but I don't have any experience with Batch scripting (and time;).

@popiolek
Copy link

UPDATE: remote part of my office told me, that this script breaks the ability to start a voice chat. I don't know how it's possible as all files are recreated on app start, but be aware of that if you use that script. Gave as a real headache to debug that.

@engelgabriel Could you tell me how deleting those 4 files may affect voice calls? I'd like to fix my script so that we could keep using it before you come up with an update but I don't really know what may the cause be and therefore how to change it.

@rodrigok rodrigok added this to the v1.3.0 milestone Feb 22, 2016
@JafryD2
Copy link

JafryD2 commented Mar 8, 2016

that script effects all notifications(in app), not just voicechat btw. We haven't tested it with the browser version.

@rodrigok rodrigok modified the milestones: v1.3.0, v1.4.0 Apr 4, 2016
@ddoron
Copy link

ddoron commented Aug 24, 2016

For anyone who needs a stopgap solution on OS X (aka macOS), this worked for me, but I'm no developer, though I doubt I'm doing any "harm":

  • close the Rocket Chat app.
  • delete the directory "chat.rocket" that in the following path:
    ~/Library/Containers/chat.rocket/
  • open the Rocket Chat app.

@bhathiya
Copy link

bhathiya commented Sep 5, 2016

For the record: In Ubuntu, deleting below directories cleared the cache.
/home/<user>/.config/Rocket.Chat+/Cache
/home/<user>/.config/Rocket.Chat+/GPUCache
/home/<user>/.cache/Rocket.Chat+

@engelgabriel engelgabriel modified the milestones: 2.0.0, 2.3.0 Jan 19, 2017
@alexbrazier alexbrazier modified the milestones: 2.3.0, 2.4.0 Feb 5, 2017
@engelgabriel engelgabriel modified the milestones: 2.5.0, 2.4.0 Feb 7, 2017
@engelgabriel engelgabriel modified the milestones: 2.6.0, 2.5.0 Mar 5, 2017
@engelgabriel engelgabriel modified the milestones: 2.6.0, 2.7.0 Mar 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants