@@ -776,6 +776,76 @@ test('slack raw-id and slug alias duplicates suppress when one context read is s
776776 assert . match ( harness . sent [ 0 ] . input . text , / M e s s a g e : \n r e a d a b l e S l a c k m e s s a g e / u)
777777} )
778778
779+ test ( 'slack edits after a blind alias claim still inject once the content changes' , async ( ) => {
780+ let messageText = 'original Slack message'
781+ const harness = makeHarness ( [ 'alice' ] , {
782+ readFileResponse : ( _workspaceId , path ) => {
783+ if ( ! path . includes ( '__proj-cloud' ) ) throw new Error ( 'remote file not ready' )
784+ return {
785+ path,
786+ revision : 'rev-context' ,
787+ contentType : 'application/json' ,
788+ content : JSON . stringify ( { provider : 'slack' , text : messageText } ) ,
789+ encoding : 'utf-8'
790+ }
791+ }
792+ } )
793+
794+ await withMockedNow ( '2026-06-05T14:00:00.000Z' , async ( ) => {
795+ await harness . bridge . reconcile ( 'project-1' , [
796+ integration ( {
797+ provider : 'slack' ,
798+ integrationId : 'slack-1' ,
799+ mountPaths : [ '/slack/channels/C123ABC__proj-cloud' ] ,
800+ downloadHistoricalData : false ,
801+ scope : { notifyAgents : [ 'alice' ] }
802+ } )
803+ ] )
804+ } )
805+
806+ // Raw-id copy first: every targeted read fails and the expanded event only
807+ // carries the sparse relayfile pointer, so the injection is blind.
808+ await harness . emit ( {
809+ ...changeEvent (
810+ '/slack/channels/C123ABC/messages/1780668000_000000/meta.json' ,
811+ 'slack' ,
812+ { digest : 'revision:raw-copy' }
813+ ) ,
814+ expand : async ( ) => ( {
815+ level : 'full' ,
816+ path : '/slack/channels/C123ABC/messages/1780668000_000000/meta.json' ,
817+ data : {
818+ path : '/slack/channels/C123ABC/messages/1780668000_000000/meta.json' ,
819+ deleted : false
820+ }
821+ } )
822+ } as ChangeEvent )
823+ await waitForSent ( harness , 1 , 2_500 )
824+ assert . equal ( harness . sent . length , 1 )
825+ assert . match ( harness . sent [ 0 ] . input . text , / M e s s a g e : u n a v a i l a b l e ; t a r g e t e d c o n t e x t r e a d d i d n o t r e t u r n c o n t e n t \. / u)
826+
827+ // The slug alias copy of the same record carries content: suppressed as a
828+ // duplicate, but the claim learns the content hash.
829+ await harness . emit ( changeEvent (
830+ '/slack/channels/C123ABC__proj-cloud/messages/1780668000_000000/meta.json' ,
831+ 'slack' ,
832+ { digest : 'revision:slug-copy' }
833+ ) )
834+ await waitForDropped ( 'project-1' , 1 , 2_500 )
835+ assert . equal ( harness . sent . length , 1 )
836+
837+ // A genuine edit changes the content hash and must inject again.
838+ messageText = 'edited Slack message'
839+ await harness . emit ( changeEvent (
840+ '/slack/channels/C123ABC__proj-cloud/messages/1780668000_000000/meta.json' ,
841+ 'slack' ,
842+ { digest : 'revision:slug-edit' }
843+ ) )
844+ await waitForSent ( harness , 2 )
845+ assert . equal ( harness . sent . length , 2 )
846+ assert . match ( harness . sent [ 1 ] . input . text , / M e s s a g e : \n e d i t e d S l a c k m e s s a g e / u)
847+ } )
848+
779849test ( 'remote replayed events older than the subscription session are dropped by default' , async ( ) => {
780850 const harness = makeHarness ( )
781851
0 commit comments