@@ -53,6 +53,7 @@ import {
5353 createOwnedWorkspaceFile ,
5454 uploadWorkspaceFile ,
5555} from '@/lib/uploads/contexts/workspace/file-manager'
56+ import { fileDocumentCacheIdentity , getE2BDocFormat } from '@/lib/uploads/documents/compile'
5657import { compiledArtifactKey , storeCompiledDoc } from '@/lib/uploads/documents/compiled-store'
5758import { fileDocumentInputIdentity } from '@/lib/uploads/documents/input-identity'
5859import { deleteUserAccount } from '@/lib/users/account-deletion'
@@ -773,7 +774,12 @@ describe('owner-scoped indexed file search on PostgreSQL and stored bytes', () =
773774 'docx' ,
774775 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' ,
775776 artifact ,
776- fileDocumentInputIdentity ( f . owner , [ dependencyRow ] )
777+ fileDocumentCacheIdentity (
778+ source ,
779+ ( await getE2BDocFormat ( 'report.docx' ) ) ! ,
780+ 'text/plain' ,
781+ fileDocumentInputIdentity ( f . owner , [ dependencyRow ] )
782+ )
777783 )
778784 const { loadFileSearchSource } = await import ( '@/lib/workspace-files/search/source' )
779785 const revision = {
@@ -866,7 +872,8 @@ describe('owner-scoped indexed file search on PostgreSQL and stored bytes', () =
866872 source ,
867873 'docx' ,
868874 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' ,
869- artifact
875+ artifact ,
876+ fileDocumentCacheIdentity ( source , ( await getE2BDocFormat ( 'transition.docx' ) ) ! , 'text/plain' )
870877 )
871878 const input = { projectId : f . projectId , fileId : generated . file . id , maxBytes : 1_000_000 }
872879 const rendered = await readProjectFileArtifact . execute ( { principal : f . reader , input } )
@@ -987,13 +994,23 @@ describe('owner-scoped indexed file search on PostgreSQL and stored bytes', () =
987994 await Packer . toBuffer (
988995 new Document ( { sections : [ { children : [ new Paragraph ( 'oldrender' ) ] } ] } )
989996 ) ,
990- fileDocumentInputIdentity ( f . owner , [ dependencyRow ] )
997+ fileDocumentCacheIdentity (
998+ source ,
999+ ( await getE2BDocFormat ( 'report.docx' ) ) ! ,
1000+ 'text/plain' ,
1001+ fileDocumentInputIdentity ( f . owner , [ dependencyRow ] )
1002+ )
9911003 )
9921004 const artifactKey = compiledArtifactKey (
9931005 f . owner ,
9941006 source ,
9951007 'docx' ,
996- fileDocumentInputIdentity ( f . owner , [ dependencyRow ] )
1008+ fileDocumentCacheIdentity (
1009+ source ,
1010+ ( await getE2BDocFormat ( 'report.docx' ) ) ! ,
1011+ 'text/plain' ,
1012+ fileDocumentInputIdentity ( f . owner , [ dependencyRow ] )
1013+ )
9971014 )
9981015 const completion = {
9991016 owner : f . owner ,
@@ -1070,13 +1087,23 @@ describe('owner-scoped indexed file search on PostgreSQL and stored bytes', () =
10701087 await Packer . toBuffer (
10711088 new Document ( { sections : [ { children : [ new Paragraph ( 'old-contributor' ) ] } ] } )
10721089 ) ,
1073- fileDocumentInputIdentity ( f . owner , [ dependencyRow ] )
1090+ fileDocumentCacheIdentity (
1091+ source ,
1092+ ( await getE2BDocFormat ( 'report.docx' ) ) ! ,
1093+ 'text/plain' ,
1094+ fileDocumentInputIdentity ( f . owner , [ dependencyRow ] )
1095+ )
10741096 )
10751097 const artifactKey = compiledArtifactKey (
10761098 f . owner ,
10771099 source ,
10781100 'docx' ,
1079- fileDocumentInputIdentity ( f . owner , [ dependencyRow ] )
1101+ fileDocumentCacheIdentity (
1102+ source ,
1103+ ( await getE2BDocFormat ( 'report.docx' ) ) ! ,
1104+ 'text/plain' ,
1105+ fileDocumentInputIdentity ( f . owner , [ dependencyRow ] )
1106+ )
10801107 )
10811108 const { markFileSearchArtifactReadyInTx } = await import (
10821109 '@/lib/workspace-files/search/artifact-ready'
0 commit comments