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

Forbid 'session' as sessionName in StoreSession.ts (Close #480) #704

Merged
merged 1 commit into from
Aug 7, 2024

Conversation

kubk
Copy link
Contributor

@kubk kubk commented Aug 7, 2024

Related issue #480

My guess the reason of the issue is that session key is being used by store2 internally and it leads to unintended overrides: https://github.com/nbubna/store/blob/0216588bc53505e290c537aaae2c52fa5ad47df8/src/store2.js#L272

The issue we're trying to solve is that when a user of gramjs is using the library for the first time, it's tempting to name the session folder session. However, doing so doesn't lead to persisting anything. The user may think the issue is related to his code or folder permissions. It's not obvious that the session name is the reason of the issue.

To solve this, I suggest forbidding the use session as a name and throwing an exception instead. Another option could be to prefix the session name with something like gramjs_${sessionName}, but I'm afraid it might cause a backward compatibility break.

@painor painor merged commit d955426 into gram-js:master Aug 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants