File tree Expand file tree Collapse file tree
packages/client-runtime/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -417,17 +417,17 @@ describe("interaction sounds", () => {
417417 expect ( reconnected . cues ) . toEqual ( [ "bloom" ] ) ;
418418 } ) ;
419419
420- it ( "compares a thread first discovered after reconnect with an idle baseline " , ( ) => {
420+ it ( "does not replay pending input when a historical thread reappears " , ( ) => {
421421 const discovered = observeThreadSoundState ( null , makeThread ( { hasPendingUserInput : true } ) , {
422422 environmentLive : true ,
423423 environmentPreviouslyLive : true ,
424424 settingsHydrated : true ,
425425 } ) ;
426426
427- expect ( discovered . cues ) . toEqual ( [ "bloom" ] ) ;
427+ expect ( discovered . cues ) . toEqual ( [ ] ) ;
428428 } ) ;
429429
430- it ( "plays completion for a thread first discovered after reconnect " , ( ) => {
430+ it ( "does not replay completion when a historical thread reappears " , ( ) => {
431431 const discovered = observeThreadSoundState (
432432 null ,
433433 makeThread ( {
@@ -448,7 +448,7 @@ describe("interaction sounds", () => {
448448 } ,
449449 ) ;
450450
451- expect ( discovered . cues ) . toEqual ( [ "success" ] ) ;
451+ expect ( discovered . cues ) . toEqual ( [ ] ) ;
452452 } ) ;
453453
454454 it ( "seeds a thread from the first live hydration without playing a cue" , ( ) => {
Original file line number Diff line number Diff line change @@ -134,29 +134,16 @@ export function observeThreadSoundState(
134134 } ,
135135) : ThreadSoundObservation {
136136 const current = [ thread ] ;
137- if ( ! options . environmentPreviouslyLive ) {
137+ if ( previous === null || ! options . environmentPreviouslyLive ) {
138138 return { state : captureThreadSoundState ( current ) , cues : [ ] } ;
139139 }
140- const baseline =
141- previous ??
142- new Map ( [
143- [
144- threadKey ( thread ) ,
145- {
146- completedTurn : null ,
147- userInitiatedTurn : null ,
148- hasPendingUserInput : false ,
149- hasPendingApprovals : false ,
150- } ,
151- ] ,
152- ] ) ;
153140
154141 if ( ! options . environmentLive || ! options . settingsHydrated ) {
155- return { state : baseline , cues : [ ] } ;
142+ return { state : previous , cues : [ ] } ;
156143 }
157144
158145 return {
159146 state : captureThreadSoundState ( current ) ,
160- cues : deriveInteractionSoundCues ( baseline , current ) ,
147+ cues : deriveInteractionSoundCues ( previous , current ) ,
161148 } ;
162149}
You can’t perform that action at this time.
0 commit comments