fix: align session status parsing and vscode reconnect reconcile (#1125)
* fix: align session status parsing and vscode reconnect reconcile * fix vscode session status fallback and reconcile cleanup safety --------- Co-authored-by: vhqtvn <8930337+vhqtvn@users.noreply.github.com> Co-authored-by: Bohdan Triapitsyn <artmore@protonmail.com>
This commit is contained in:
committed by
GitHub
co-authored by
vhqtvn
Bohdan Triapitsyn
parent
3a98987f71
commit
82b36e5080
@@ -29,7 +29,7 @@ describe('session runtime', () => {
|
||||
type: 'session.status',
|
||||
properties: {
|
||||
sessionID: 'session-1',
|
||||
info: {
|
||||
status: {
|
||||
type: 'busy',
|
||||
},
|
||||
},
|
||||
@@ -39,7 +39,7 @@ describe('session runtime', () => {
|
||||
type: 'session.status',
|
||||
properties: {
|
||||
sessionID: 'session-1',
|
||||
info: {
|
||||
status: {
|
||||
type: 'idle',
|
||||
},
|
||||
},
|
||||
@@ -65,4 +65,36 @@ describe('session runtime', () => {
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
it('accepts legacy session.status info.type payloads', () => {
|
||||
const events = [];
|
||||
const runtime = createSessionRuntime({
|
||||
writeSseEvent() {
|
||||
throw new Error('SSE fallback should not be used when broadcastEvent is provided');
|
||||
},
|
||||
getNotificationClients: () => new Set(),
|
||||
broadcastEvent: (payload) => {
|
||||
events.push(payload);
|
||||
},
|
||||
});
|
||||
runtimes.push(runtime);
|
||||
|
||||
runtime.processOpenCodeSsePayload({
|
||||
type: 'session.status',
|
||||
properties: {
|
||||
sessionID: 'legacy-session-1',
|
||||
info: {
|
||||
type: 'busy',
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
expect(events).toContainEqual({
|
||||
type: 'openchamber:session-status',
|
||||
properties: expect.objectContaining({
|
||||
sessionId: 'legacy-session-1',
|
||||
status: 'busy',
|
||||
}),
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user