@@ -84,13 +84,13 @@ export class CDCStreamTestContext implements AsyncDisposable {
8484 }
8585
8686 async loadNextSyncRules ( ) {
87- const syncRules = await this . factory . getDeployingSyncConfigContent ( ) ;
88- if ( syncRules == null ) {
87+ const syncConfigContent = await this . factory . getDeployingSyncConfigContent ( ) ;
88+ if ( syncConfigContent == null ) {
8989 throw new Error ( `Next replication stream not available` ) ;
9090 }
9191
92- this . syncRulesContent = syncRules ;
93- const replicationStream = await this . factory . getReplicationStream ( syncRules . replicationStreamId ) ;
92+ this . syncRulesContent = syncConfigContent ;
93+ const replicationStream = await this . factory . getReplicationStream ( syncConfigContent . replicationStreamId ) ;
9494 if ( replicationStream == null ) {
9595 throw new Error ( `Next replication stream not available` ) ;
9696 }
@@ -99,21 +99,21 @@ export class CDCStreamTestContext implements AsyncDisposable {
9999 }
100100
101101 async loadActiveSyncRules ( ) {
102- const syncRules = await this . factory . getActiveSyncConfigContent ( ) ;
103- if ( syncRules == null ) {
102+ const syncConfigContent = await this . factory . getActiveSyncConfigContent ( ) ;
103+ if ( syncConfigContent == null ) {
104104 throw new Error ( `Active replication stream not available` ) ;
105105 }
106106
107- this . syncRulesContent = syncRules ;
108- const replicationStream = await this . factory . getReplicationStream ( syncRules . replicationStreamId ) ;
107+ this . syncRulesContent = syncConfigContent ;
108+ const replicationStream = await this . factory . getReplicationStream ( syncConfigContent . replicationStreamId ) ;
109109 if ( replicationStream == null ) {
110110 throw new Error ( `Active replication stream not available` ) ;
111111 }
112112 this . storage = this . factory . getInstance ( replicationStream ) ;
113113 return this . storage ! ;
114114 }
115115
116- private getSyncRulesContent ( ) : storage . PersistedSyncConfigContent {
116+ private getSyncConfigContent ( ) : storage . PersistedSyncConfigContent {
117117 if ( this . syncRulesContent == null ) {
118118 throw new Error ( 'Sync config not configured - call updateSyncRules() first' ) ;
119119 }
@@ -191,8 +191,8 @@ export class CDCStreamTestContext implements AsyncDisposable {
191191
192192 async getBucketsDataBatch ( buckets : Record < string , InternalOpId > , options ?: { timeout ?: number } ) {
193193 let checkpoint = await this . getCheckpoint ( options ) ;
194- const syncRules = this . getSyncRulesContent ( ) ;
195- const map = Object . entries ( buckets ) . map ( ( [ bucket , start ] ) => bucketRequest ( syncRules , bucket , start ) ) ;
194+ const syncConfigContent = this . getSyncConfigContent ( ) ;
195+ const map = Object . entries ( buckets ) . map ( ( [ bucket , start ] ) => bucketRequest ( syncConfigContent , bucket , start ) ) ;
196196 return test_utils . fromAsync ( this . storage ! . getBucketDataBatch ( checkpoint , map ) ) ;
197197 }
198198
@@ -204,9 +204,9 @@ export class CDCStreamTestContext implements AsyncDisposable {
204204 if ( typeof start == 'string' ) {
205205 start = BigInt ( start ) ;
206206 }
207- const syncRules = this . getSyncRulesContent ( ) ;
207+ const syncConfigContent = this . getSyncConfigContent ( ) ;
208208 const checkpoint = await this . getCheckpoint ( options ) ;
209- let map = [ bucketRequest ( syncRules , bucket , start ) ] ;
209+ let map = [ bucketRequest ( syncConfigContent , bucket , start ) ] ;
210210 let data : OplogEntry [ ] = [ ] ;
211211 while ( true ) {
212212 const batch = this . storage ! . getBucketDataBatch ( checkpoint , map ) ;
@@ -216,7 +216,7 @@ export class CDCStreamTestContext implements AsyncDisposable {
216216 if ( batches . length == 0 || ! batches [ 0 ] ! . chunkData . has_more ) {
217217 break ;
218218 }
219- map = [ bucketRequest ( syncRules , bucket , BigInt ( batches [ 0 ] ! . chunkData . next_after ) ) ] ;
219+ map = [ bucketRequest ( syncConfigContent , bucket , BigInt ( batches [ 0 ] ! . chunkData . next_after ) ) ] ;
220220 }
221221 return data ;
222222 }
@@ -235,8 +235,8 @@ export class CDCStreamTestContext implements AsyncDisposable {
235235 start = BigInt ( start ) ;
236236 }
237237 const { checkpoint } = await this . storage ! . getCheckpoint ( ) ;
238- const syncRules = this . getSyncRulesContent ( ) ;
239- const map = [ bucketRequest ( syncRules , bucket , start ) ] ;
238+ const syncConfigContent = this . getSyncConfigContent ( ) ;
239+ const map = [ bucketRequest ( syncConfigContent , bucket , start ) ] ;
240240 const batch = this . storage ! . getBucketDataBatch ( checkpoint , map ) ;
241241 const batches = await test_utils . fromAsync ( batch ) ;
242242 return batches [ 0 ] ?. chunkData . data ?? [ ] ;
0 commit comments