Commit c258d9f
fix: Preserve session metadata in external storage mode
- Call onsessioninitialized handler BEFORE storing session data
- Merge existing session data (including metadata) when updating
- Prevents overwrites of custom metadata (e.g., serverId) set by handlers
This fix ensures that applications using external session storage can
store additional metadata (like serverId for cross-pod recovery) via
the onsessioninitialized callback without it being overwritten by the
SDK's internal storeSession call.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>1 parent 30a3633 commit c258d9f
1 file changed
+16
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
768 | 768 | | |
769 | 769 | | |
770 | 770 | | |
771 | | - | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
772 | 779 | | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
773 | 784 | | |
774 | 785 | | |
775 | 786 | | |
776 | | - | |
777 | | - | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
778 | 791 | | |
779 | 792 | | |
780 | 793 | | |
781 | 794 | | |
782 | | - | |
783 | | - | |
784 | | - | |
785 | | - | |
786 | | - | |
787 | 795 | | |
788 | 796 | | |
789 | 797 | | |
| |||
0 commit comments