fix: prevent message sync between forked sessions by generating unique IDs #6033
+5
β1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
π» εζ΄η±»ε | Change Type
π εζ΄θ―΄ζ | Description of Change
Fixed message synchronization issue in chat session fork functionality. In the previous implementation, messages in forked sessions shared the same object references with the original session, causing edits in one session to affect the other. This has been resolved by implementing deep copy of messages during fork operation and generating new IDs for each message, ensuring complete independence between sessions.
Key changes:
forkSession
methodπ θ‘₯ε δΏ‘ζ― | Additional Information
This fix addresses the following scenarios:
This change does not impact other functionalities and only optimizes the session fork behavior to meet user expectations.
Summary by CodeRabbit