File tree Expand file tree Collapse file tree 2 files changed +9
-7
lines changed
libs/engine/src/app/services/link-db Expand file tree Collapse file tree 2 files changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -15,9 +15,9 @@ export type IndexedContext = {
1515}
1616
1717export type IndexObject = {
18- appId : string
18+ appId ? : string
1919 documentId ?: string
20- mutationId : string
20+ mutationId ? : string
2121 context : IndexedContext
2222}
2323
Original file line number Diff line number Diff line change @@ -122,17 +122,19 @@ export class LinkDbService {
122122 indexRules : LinkIndexRules ,
123123 context : TransferableContext
124124 ) : IndexObject {
125- // MutationId is a part of the index.
126- // It means that a data of the same application is different in different mutations
127-
128125 const index : IndexObject = {
129- mutationId,
130- appId,
131126 context : LinkDbService . _buildIndexedContextValues ( indexRules , context ) ,
132127 }
133128
129+ // ToDo: non-obvious indexing. Documents are mutation-independent
134130 if ( documentId ) {
131+ // Document can be reused in different mutations and apps
135132 index . documentId = documentId
133+ } else {
134+ // MutationId is a part of the index.
135+ // It means that a data of the same application is different in different mutations
136+ index . mutationId = mutationId
137+ index . appId = appId
136138 }
137139
138140 return index
You can’t perform that action at this time.
0 commit comments