Repository navigation
fix(core): handle inherited-key message identifiers - #1446
liangzhechen655 wants to merge 2 commits into
Conversation
🦋 Changeset detectedLatest commit: db5f07a The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to No actionable merge-blocking risk is established in the special-identifier storage changes. Pre-merge checks |
|
There was a problem hiding this comment.
All reported issues were addressed across 3 files
Reply with feedback, questions, or to request a fix.
View guided diff | Re-trigger cubic
What is the current behavior?
In-memory message storage uses plain objects as user and conversation dictionaries. String identifiers such as
constructor,toStringand__proto__resolve to inherited object properties instead of message buckets. Reading an empty conversation can throwmessages.sort is not a function, and inherited user buckets can bypass the expected isolation and statistics.What is the new behavior?
Use dictionaries without prototypes at both levels, including the empty-read fallback and resets after clearing messages or storage. Reserved-looking strings behave like other identifiers. Parameterized tests cover empty reads, per-user isolation, adding/deleting messages, conversation clearing, user clearing and complete storage resets.
Validation
PR Checklist
Summary by cubic
Fixes
@voltagent/corein-memory message storage so user and conversation identifiers likeconstructor,toString, and__proto__are treated as ordinary strings. Previously these identifiers resolved to inherited object properties, causingmessages.sort is not a functionerrors on empty reads and letting inherited buckets bypass per-user isolation and statistics.Bug Fixes
Written for commit db5f07a. Summary will update on new commits.
Summary by CodeRabbit
constructor,toString, and__proto__, including after user-specific or full storage clears.