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

ConverseJS : is there a way to not store data in localStorage? #39

Closed
JohnXLivingston opened this issue May 6, 2021 · 6 comments
Closed
Labels
bug Something isn't working enhancement New feature or request Prosody

Comments

@JohnXLivingston
Copy link
Owner

When in developing, localStorage cache can cause troubles.
Is there a way to not store anything?
At least use sessionStorage ?

Can there be problems in productions instances?

@JohnXLivingston JohnXLivingston added bug Something isn't working enhancement New feature or request Prosody labels May 6, 2021
@jcbrand
Copy link

jcbrand commented May 6, 2021

What is the issue you're running into?

I've done some work recently to make IndexedDB a viable alternative to localStorage, but you'll have to use a build from the current master branch, there is no release for it yet.

The master branch is however relatively stable and used in production.

@JohnXLivingston
Copy link
Owner Author

Thanks for your reply.
I made this issue as a TODO. I'm not sure that it is really a problem for now. I have to ensure that peertube will not have problem sharing the localStorage with another app (Peertube is supposed to be alone on the domain).

@jcbrand
Copy link

jcbrand commented May 6, 2021

Converse prefixes everything that gets saved in localStorage, so it's unlikely to cause issues.

However, you can run into a situation where localStorage fills up, which is why I added support for IndexedDB.

@JohnXLivingston
Copy link
Owner Author

Converse prefixes, but peertube don't. I need to check Peertube's code.
And I have some side effect when I change Prosody config, due to ConverseJS data in localStorage.
Nothing Serious.

And I plan to use muc_mam to keep room history. So I don't know if i really need ConverseJS to keep data, such as chat history (it is difficult for me, when I develop, to know if messages displayed after a refresh comes from ConverseJS or from the server).

@jcbrand
Copy link

jcbrand commented May 7, 2021

Converse caches chat data so that when you reload you don't have to query the XMPP server again. For some sites it's not a big deal to query the XMPP server again, but for others it's not an option because the page can load many times per minute.

@XaviFP worked on creating a store for Converse that doesn't persist any chat data, but it never got merged:
conversejs/converse.js#2356

Perhaps it could still be salvaged. If you used that, then messages would always be fetched from the XMPP server on page reload.

@JohnXLivingston
Copy link
Owner Author

Thanks for the link! That's interesting.

@JohnXLivingston JohnXLivingston changed the title ConverseJS : is there a way to not store date in localStorage? ConverseJS : is there a way to not store data in localStorage? May 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request Prosody
Projects
None yet
Development

No branches or pull requests

2 participants