Skip to content

[Bug]: Session List Contamination #213

@sadrasabouri

Description

@sadrasabouri

Contact details

sabouri.sadra@gmail.com

What happened?

When two independent memor Session's are created, the message list is shared between them.
This bug probably has to do with the message initialization we have for the Session class (i.e., using self._messages = [] instead of something like self._messages = None).

Steps to reproduce

from memor import Session

a = Session()
b = Session()

print(a._messages is b._messages)
print(a._messages == b._messages)

a._messages.append("hello")

print(b._messages)

Expected behavior

False
False
[]

Actual behavior

True
True
["hello"]

Operating system

macOS

Python version

Python 3.13

Memor version

Memor 1.1

Metadata

Metadata

Labels

bugSomething isn't working

Type

No fields configured for Bug.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions