mirror of
https://github.com/wu736139669/hapi.git
synced 2026-10-14 20:26:05 +00:00
fix(web): preserve the visible chat window during rewind (#1766)
* fix(web): preserve chat window during rewind * fix(web): scope rewind invalidation preservation * fix(web): clear unknown rewind boundaries * fix(web): deduplicate rewind invalidations * fix(web): retain rewind dedupe history
This commit is contained in:
@@ -81,6 +81,18 @@ describe('resume schemas', () => {
|
||||
}).success).toBe(true)
|
||||
})
|
||||
|
||||
it('accepts rewind details on messages-invalidated events', () => {
|
||||
expect(SyncEventSchema.parse({
|
||||
type: 'messages-invalidated',
|
||||
sessionId: 'session-1',
|
||||
reason: 'rewind',
|
||||
truncateFromLocalId: 'user-message-1'
|
||||
})).toMatchObject({
|
||||
reason: 'rewind',
|
||||
truncateFromLocalId: 'user-message-1'
|
||||
})
|
||||
})
|
||||
|
||||
it('validates structured session and machine update patches', () => {
|
||||
expect(SyncEventSchema.safeParse({
|
||||
type: 'session-updated',
|
||||
|
||||
@@ -558,7 +558,9 @@ export const SyncEventSchema = z.discriminatedUnion('type', [
|
||||
message: DecryptedMessageSchema
|
||||
}),
|
||||
SessionChangedSchema.extend({
|
||||
type: z.literal('messages-invalidated')
|
||||
type: z.literal('messages-invalidated'),
|
||||
reason: z.literal('rewind').optional(),
|
||||
truncateFromLocalId: z.string().min(1).optional()
|
||||
}),
|
||||
SessionChangedSchema.extend({
|
||||
type: z.literal('scheduled-matured')
|
||||
|
||||
Reference in New Issue
Block a user