@powersync/service-module-mongodb 0.15.2 → 0.15.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @powersync/service-module-mongodb
2
2
 
3
+ ## 0.15.3
4
+
5
+ ### Patch Changes
6
+
7
+ - 11b4deb: Restructure `powersync_replication_lag_seconds` metric.
8
+ - Updated dependencies [df451c6]
9
+ - Updated dependencies [dea1e00]
10
+ - Updated dependencies [ada86f2]
11
+ - Updated dependencies [11b4deb]
12
+ - @powersync/service-core@1.20.4
13
+ - @powersync/service-sync-rules@0.34.1
14
+ - @powersync/lib-services-framework@0.9.2
15
+ - @powersync/lib-service-mongodb@0.6.23
16
+
3
17
  ## 0.15.2
4
18
 
5
19
  ### Patch Changes
@@ -1,7 +1,7 @@
1
1
  import { mongo } from '@powersync/lib-service-mongodb';
2
2
  import { DatabaseConnectionError, Logger } from '@powersync/lib-services-framework';
3
3
  import { MetricsEngine, SourceEntityDescriptor, SourceTable, storage } from '@powersync/service-core';
4
- import { DatabaseInputRow, SqliteInputRow, HydratedSyncRules, TablePattern } from '@powersync/service-sync-rules';
4
+ import { DatabaseInputRow, HydratedSyncRules, SqliteInputRow, TablePattern } from '@powersync/service-sync-rules';
5
5
  import { MongoManager } from './MongoManager.js';
6
6
  export interface ChangeStreamOptions {
7
7
  connections: MongoManager;
@@ -48,16 +48,7 @@ export declare class ChangeStream {
48
48
  private readonly maxAwaitTimeMS;
49
49
  private abort_signal;
50
50
  private relationCache;
51
- /**
52
- * Time of the oldest uncommitted change, according to the source db.
53
- * This is used to determine the replication lag.
54
- */
55
- private oldestUncommittedChange;
56
- /**
57
- * Keep track of whether we have done a commit or keepalive yet.
58
- * We can only compute replication lag if isStartingReplication == false, or oldestUncommittedChange is present.
59
- */
60
- private isStartingReplication;
51
+ private replicationLag;
61
52
  private checkpointStreamId;
62
53
  private logger;
63
54
  private snapshotChunkLength;
@@ -108,7 +99,7 @@ export declare class ChangeStream {
108
99
  private openChangeStream;
109
100
  private getBufferedChangeCount;
110
101
  streamChangesInternal(): Promise<void>;
111
- getReplicationLagMillis(): Promise<number | undefined>;
102
+ getReplicationLagMillis(): number | undefined;
112
103
  private lastTouchedAt;
113
104
  private touch;
114
105
  }