@@ -192,24 +192,34 @@ export class SharedTree
192
192
const schemaSummarizer = new SchemaSummarizer ( runtime , schema , options , {
193
193
getCurrentSeq : ( ) => this . runtime . deltaManager . lastSequenceNumber ,
194
194
} ) ;
195
- const fieldBatchCodec = makeFieldBatchCodec ( options , {
196
- // TODO: provide schema here to enable schema based compression.
195
+ const opFieldBatchCodec = makeFieldBatchCodec ( options , {
196
+ // TODO: Currently unsure which schema should be passed if an op contains a schema edit, so it is not enabled.
197
+ // This should eventually handle that case, and pass in the correct schema accordingly.
197
198
// schema: {
198
199
// schema,
199
200
// policy: defaultSchemaPolicy,
200
201
// },
201
- encodeType : TreeCompressionStrategy . Compressed ,
202
+ encodeType : options . summaryEncodeType ,
203
+ } ) ;
204
+
205
+ // Separate field batch codec created as summarization does not need to handle the case of an op containing a schema edit.
206
+ const summaryFieldBatchCodec = makeFieldBatchCodec ( options , {
207
+ schema : {
208
+ schema,
209
+ policy : defaultSchemaPolicy ,
210
+ } ,
211
+ encodeType : options . summaryEncodeType ,
202
212
} ) ;
203
213
const forestSummarizer = new ForestSummarizer (
204
214
forest ,
205
215
runtime . idCompressor ,
206
- fieldBatchCodec ,
216
+ summaryFieldBatchCodec ,
207
217
options ,
208
218
) ;
209
219
const removedRootsSummarizer = new DetachedFieldIndexSummarizer ( removedRoots ) ;
210
220
const innerChangeFamily = new SharedTreeChangeFamily (
211
221
runtime . idCompressor ,
212
- fieldBatchCodec ,
222
+ opFieldBatchCodec ,
213
223
options ,
214
224
) ;
215
225
const changeFamily = makeMitigatedChangeFamily (
@@ -250,7 +260,7 @@ export class SharedTree
250
260
changeFamily,
251
261
schema,
252
262
forest,
253
- fieldBatchCodec,
263
+ fieldBatchCodec : opFieldBatchCodec ,
254
264
events : this . _events ,
255
265
removedRoots,
256
266
} ) ;
0 commit comments