Skip to content

chore: do not share data between memory sessions - #13

Merged
KnorpelSenf merged 7 commits into
grammyjs:mainfrom
LWJerri:chore/deep-copy
Jan 23, 2026
Merged

KnorpelSenf merged 7 commits into
grammyjs:mainfrom
LWJerri:chore/deep-copy

Conversation

@LWJerri

@LWJerri LWJerri commented Nov 10, 2025

Copy link
Copy Markdown
Contributor

Closes #4

@KnorpelSenf KnorpelSenf left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is there a reason to avoid structuredClone?

Comment thread mod.ts Resolved
@KnorpelSenf KnorpelSenf changed the title chore: Do not share data between memory sessions chore: do not share data between memory sessions Nov 10, 2025
@LWJerri
LWJerri marked this pull request as draft November 11, 2025 00:14
@LWJerri
LWJerri marked this pull request as ready for review January 23, 2026 10:06
@LWJerri
LWJerri requested a review from KnorpelSenf January 23, 2026 10:06
@LWJerri LWJerri changed the title chore: do not share data between memory sessions chore: Do not share data between memory sessions Jan 23, 2026
Comment thread mod.ts Resolved
@KnorpelSenf KnorpelSenf reopened this Jan 23, 2026
@KnorpelSenf

Copy link
Copy Markdown
Member

oops

@KnorpelSenf KnorpelSenf left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It's certainly an interesting decision to clone all values passed to the storage adapter, too. #4 only mentions memory sessions because they live in RAM and traditionally share data between requests. Usually, I'd expect persistent storage adapters to serialise the data anyway, making your cloning redundant.

What was the reason for this decision?

@KnorpelSenf KnorpelSenf changed the title chore: Do not share data between memory sessions chore: do not share data between memory sessions Jan 23, 2026
@LWJerri
LWJerri requested a review from KnorpelSenf January 23, 2026 10:33

@KnorpelSenf KnorpelSenf left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@KnorpelSenf
KnorpelSenf merged commit faf95f2 into grammyjs:main Jan 23, 2026
6 checks passed
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.

fix: do not share data between memory sessions

2 participants