@lpdjs/firestore-repo-service 2.3.1 → 2.3.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.
@@ -1,4 +1,4 @@
1
- import { a as SqlAdapter, S as SyncEvent } from './types-DXoT10nB.js';
1
+ import { a as SqlAdapter, S as SyncEvent } from './types-CBwcflkG.js';
2
2
 
3
3
  /**
4
4
  * Per-repo in-memory batch buffer.
@@ -29,6 +29,7 @@ interface SyncQueueOptions {
29
29
  declare class SyncQueue {
30
30
  private buffer;
31
31
  private flushing;
32
+ private flushPromise;
32
33
  private timer;
33
34
  private readonly adapter;
34
35
  private readonly tableName;
@@ -43,8 +44,16 @@ declare class SyncQueue {
43
44
  /**
44
45
  * Flush all buffered events to the SQL adapter.
45
46
  * Upserts and deletes are batched separately.
47
+ *
48
+ * Concurrent callers (e.g. several PubSub messages handled in parallel
49
+ * inside the same Cloud Function instance with `concurrency > 1`) all
50
+ * await the same in-flight flush and then trigger a follow-up flush if
51
+ * new events were enqueued in the meantime. This guarantees that every
52
+ * caller's event is persisted before its `await flush()` resolves —
53
+ * which is required for safe PubSub ack semantics.
46
54
  */
47
55
  flush(): Promise<void>;
56
+ private _doFlush;
48
57
  /** Stop the auto-flush timer and flush remaining events. */
49
58
  shutdown(): Promise<void>;
50
59
  }
@@ -1,4 +1,4 @@
1
- import { a as SqlAdapter, S as SyncEvent } from './types-BTt_FmeC.cjs';
1
+ import { a as SqlAdapter, S as SyncEvent } from './types-BW592RAZ.cjs';
2
2
 
3
3
  /**
4
4
  * Per-repo in-memory batch buffer.
@@ -29,6 +29,7 @@ interface SyncQueueOptions {
29
29
  declare class SyncQueue {
30
30
  private buffer;
31
31
  private flushing;
32
+ private flushPromise;
32
33
  private timer;
33
34
  private readonly adapter;
34
35
  private readonly tableName;
@@ -43,8 +44,16 @@ declare class SyncQueue {
43
44
  /**
44
45
  * Flush all buffered events to the SQL adapter.
45
46
  * Upserts and deletes are batched separately.
47
+ *
48
+ * Concurrent callers (e.g. several PubSub messages handled in parallel
49
+ * inside the same Cloud Function instance with `concurrency > 1`) all
50
+ * await the same in-flight flush and then trigger a follow-up flush if
51
+ * new events were enqueued in the meantime. This guarantees that every
52
+ * caller's event is persisted before its `await flush()` resolves —
53
+ * which is required for safe PubSub ack semantics.
46
54
  */
47
55
  flush(): Promise<void>;
56
+ private _doFlush;
48
57
  /** Stop the auto-flush timer and flush remaining events. */
49
58
  shutdown(): Promise<void>;
50
59
  }