@@ -193,11 +193,9 @@ let removeQueuedMessage: typeof import("./chat-queue.ts").removeQueuedMessage;
193193let removeDeliveredQueuedChatSendForRun : typeof import ( "./chat-queue.ts" ) . removeDeliveredQueuedChatSendForRun ;
194194let removeVisibleOrScopedQueuedMessageWithoutReleasing : typeof import ( "./chat-queue.ts" ) . removeVisibleOrScopedQueuedMessageWithoutReleasing ;
195195let markQueuedChatSendsWaitingForReconnect : typeof import ( "./chat-queue.ts" ) . markQueuedChatSendsWaitingForReconnect ;
196- let keepVolatileQueuedMessage : typeof import ( "./chat-queue.ts" ) . keepVolatileQueuedMessage ;
197196let subscribeChatOutboxProjection : typeof import ( "./chat-queue.ts" ) . subscribeChatOutboxProjection ;
198197let syncVisibleChatQueueProjection : typeof import ( "./chat-queue.ts" ) . syncVisibleChatQueueProjection ;
199198let readChatQueueForScope : typeof import ( "./chat-queue.ts" ) . readChatQueueForScope ;
200- let readQueuedMessageById : typeof import ( "./chat-queue.ts" ) . readQueuedMessageById ;
201199let flushChatQueueForEvent : typeof import ( "./chat-send-actions.ts" ) . flushChatQueueForEvent ;
202200let retryReconnectableQueuedChatSends : typeof import ( "./chat-send-actions.ts" ) . retryReconnectableQueuedChatSends ;
203201let retryQueuedChatMessage : typeof import ( "./chat-send-actions.ts" ) . retryQueuedChatMessage ;
@@ -225,10 +223,8 @@ async function loadChatHelpers(): Promise<void> {
225223 removeDeliveredQueuedChatSendForRun,
226224 removeQueuedMessage,
227225 markQueuedChatSendsWaitingForReconnect,
228- keepVolatileQueuedMessage,
229226 removeVisibleOrScopedQueuedMessageWithoutReleasing,
230227 readChatQueueForScope,
231- readQueuedMessageById,
232228 subscribeChatOutboxProjection,
233229 syncVisibleChatQueueProjection,
234230 } = await import ( "./chat-queue.ts" ) ) ;
@@ -7795,16 +7791,8 @@ describe("handleSendChat", () => {
77957791 ) . toEqual ( [ expect . objectContaining ( { sendAttempts : 1 , sendState : "waiting-reconnect" } ) ] ) ;
77967792 } ) ;
77977793
7798- it ( "projects every active queued send as waiting after a disconnect" , ( ) => {
7794+ it ( "marks saved session queued sends waiting after a disconnect" , ( ) => {
77997795 const host = makeChatHost ( { chatQueue : [ ] } ) ;
7800- const volatile = {
7801- id : "volatile-send" ,
7802- text : "in flight" ,
7803- createdAt : 0 ,
7804- sendRunId : "run-volatile" ,
7805- sendState : "sending" as const ,
7806- sessionKey : "agent:a" ,
7807- } ;
78087796 writeChatQueueForScope ( host , "agent:a" , [
78097797 {
78107798 id : "pending-send-a" ,
@@ -7815,15 +7803,10 @@ describe("handleSendChat", () => {
78157803 sessionKey : "agent:a" ,
78167804 } ,
78177805 ] ) ;
7818- keepVolatileQueuedMessage ( host , "agent:a" , volatile , undefined , { retryable : true } ) ;
78197806
78207807 markQueuedChatSendsWaitingForReconnect ( host ) ;
78217808
7822- expect ( readQueuedMessageById ( host , volatile . id ) ) . toMatchObject ( {
7823- sendRunId : "run-volatile" ,
7824- sendState : "waiting-reconnect" ,
7825- } ) ;
7826- expect ( readQueuedMessageById ( host , "pending-send-a" ) ) . toMatchObject ( {
7809+ expect ( readChatQueueForScope ( host , "agent:a" ) [ 0 ] ) . toMatchObject ( {
78277810 sendRunId : "run-a" ,
78287811 sendState : "waiting-reconnect" ,
78297812 } ) ;
0 commit comments