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
@@ -716,9 +716,12 @@ const processForwardedEventPayload = (payload, emitSyntheticEvent) => {
|
||||
}
|
||||
|
||||
const properties = payload.properties && typeof payload.properties === 'object' ? payload.properties : {};
|
||||
const statusInfo = properties.status && typeof properties.status === 'object' ? properties.status : {};
|
||||
const info = properties.info && typeof properties.info === 'object' ? properties.info : {};
|
||||
const sessionId = typeof properties.sessionID === 'string' ? properties.sessionID.trim() : '';
|
||||
const status = typeof info.type === 'string' ? info.type.trim() : '';
|
||||
const status = typeof statusInfo.type === 'string'
|
||||
? statusInfo.type.trim()
|
||||
: (typeof info.type === 'string' ? info.type.trim() : '');
|
||||
|
||||
if (!sessionId || !status) {
|
||||
return;
|
||||
@@ -731,9 +734,15 @@ const processForwardedEventPayload = (payload, emitSyntheticEvent) => {
|
||||
status,
|
||||
timestamp: Date.now(),
|
||||
metadata: {
|
||||
attempt: typeof info.attempt === 'number' ? info.attempt : undefined,
|
||||
message: typeof info.message === 'string' ? info.message : undefined,
|
||||
next: typeof info.next === 'number' ? info.next : undefined,
|
||||
attempt: typeof statusInfo.attempt === 'number'
|
||||
? statusInfo.attempt
|
||||
: (typeof info.attempt === 'number' ? info.attempt : undefined),
|
||||
message: typeof statusInfo.message === 'string'
|
||||
? statusInfo.message
|
||||
: (typeof info.message === 'string' ? info.message : undefined),
|
||||
next: typeof statusInfo.next === 'number'
|
||||
? statusInfo.next
|
||||
: (typeof info.next === 'number' ? info.next : undefined),
|
||||
},
|
||||
needsAttention: false,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user