Track live open canvas snapshots#1447
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR updates the Rust SDK session event loop to keep Session::open_canvases() synchronized with live session.canvas.opened notifications, while preserving snapshot ordering when the same canvas instance is re-opened. It also adds Rust test coverage to validate malformed-payload tolerance, live additions, and live upserts.
Changes:
- Share an
open_canvasessnapshot store with the session event loop and update it onsession.canvas.openednotifications via an upsert helper. - Populate
open_canvasesfromsession.resumeresponses while keeping theSessionAPI unchanged. - Add a new Rust test covering live updates and upsert behavior for repeated
instanceIds.
Show a summary per file
| File | Description |
|---|---|
| rust/src/session.rs | Tracks and upserts open canvas snapshots on session.canvas.opened events; wires shared state into the event loop and resume path. |
| rust/tests/session_test.rs | Adds a new test validating malformed event tolerance plus live add/upsert snapshot behavior. |
Copilot's findings
- Files reviewed: 2/2 changed files
- Comments generated: 2
|
@jmoseley Looks good. I'm guessing a similar fix is also needed for the other languages. Is that correct? |
|
Yes, will work on that. |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
- rust: upsert resume snapshots instead of wholesale replace, so live session.canvas.opened notifications received during session.resume are preserved. - rust: update capabilities and open canvas snapshots BEFORE broadcasting the event, so subscribers observe current state when handling the event. - dotnet: dispose MemoryStreams on construction failure in test helper. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Cross-SDK Consistency Review ✅This PR implements live
Behavioral parity confirmed:
No consistency gaps found. 🎉
|
Summary
Validation
Paired github-app branch pins this SDK WIP via .sdk-upstream-sha until the normal sync lands.