fix(sync): compare retry status metadata (#1141)
* fix(sync): compare retry status metadata * fix(sync): compare status fields directly --------- Co-authored-by: Isaac Sanchez <isanchez-hawkins@arize.com>
This commit is contained in:
committed by
GitHub
co-authored by
Isaac Sanchez
parent
4b65a16b12
commit
47fc6a4606
@@ -3,6 +3,7 @@ import { describe, expect, it } from 'bun:test'
|
||||
import {
|
||||
aggregateLiveSessions,
|
||||
aggregateLiveSessionStatuses,
|
||||
areStatusMapsEquivalent,
|
||||
findLiveSession,
|
||||
findLiveSessionStatus,
|
||||
} from '../live-aggregate.ts'
|
||||
@@ -79,6 +80,20 @@ describe('live aggregate', () => {
|
||||
expect(findLiveSessionStatus(states, 'ses-1')?.type).toBe('idle')
|
||||
})
|
||||
|
||||
it('detects retry metadata changes in status maps', () => {
|
||||
const retryStatus = { type: 'retry', message: 'retrying|server|message', attempt: 1, next: 100 }
|
||||
|
||||
expect(areStatusMapsEquivalent(
|
||||
{ 'ses-1': retryStatus },
|
||||
{ 'ses-1': { ...retryStatus } },
|
||||
)).toBe(true)
|
||||
|
||||
expect(areStatusMapsEquivalent(
|
||||
{ 'ses-1': retryStatus },
|
||||
{ 'ses-1': { ...retryStatus, attempt: 2, next: 200 } },
|
||||
)).toBe(false)
|
||||
})
|
||||
|
||||
it('derives active-now sessions from live statuses instead of persisted history', () => {
|
||||
const sessions = [
|
||||
session('ses-1', '/a', 20),
|
||||
|
||||
Reference in New Issue
Block a user