Function
buildResyncRequired
(
sessionId: string,
reason: 'buffer_overflow' | 'session_recreated' | 'epoch_changed',
currentSeq: number,
epoch?: string,
)
Source from the content-addressed store, hash-verified
| 148 | } |
| 149 | |
| 150 | export function buildResyncRequired( |
| 151 | sessionId: string, |
| 152 | reason: 'buffer_overflow' | 'session_recreated' | 'epoch_changed', |
| 153 | currentSeq: number, |
| 154 | epoch?: string, |
| 155 | ): ResyncRequiredFrame { |
| 156 | return { |
| 157 | type: 'resync_required', |
| 158 | timestamp: new Date().toISOString(), |
| 159 | payload: { |
| 160 | session_id: sessionId, |
| 161 | reason, |
| 162 | current_seq: currentSeq, |
| 163 | ...(epoch !== undefined ? { epoch } : {}), |
| 164 | }, |
| 165 | }; |
| 166 | } |
Tested by
no test coverage detected