@rljson/db 0.0.22 → 0.0.23

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.
@@ -73,6 +73,20 @@ export declare class Connector {
73
73
  * @param callback - Invoked with the detected Conflict
74
74
  */
75
75
  onConflict(callback: ConflictCallback): void;
76
+ /**
77
+ * Removes a ref from the received-dedup set so a later re-advertisement of
78
+ * the same ref (e.g. the server's bootstrap heartbeat, which only re-sends
79
+ * the *latest* ref) is delivered to listeners again instead of being
80
+ * silently deduplicated.
81
+ *
82
+ * A ref is added to the dedup set the instant it is *received* — before the
83
+ * listener callback (which materializes it) has a chance to succeed. If that
84
+ * apply step fails terminally, the ref is stuck in the dedup set forever and
85
+ * the heartbeat can never heal it. Consumers whose apply failed call this so
86
+ * recovery becomes eventually-consistent rather than permanent loss.
87
+ * @param ref - The ref to allow re-delivery for.
88
+ */
89
+ invalidateReceived(ref: string): void;
76
90
  /**
77
91
  * Returns the current sequence number.
78
92
  * Only meaningful when `causalOrdering` is enabled.
package/dist/db.js CHANGED
@@ -141,6 +141,24 @@ class Connector {
141
141
  this._conflictCallbacks.push(callback);
142
142
  }
143
143
  // ...........................................................................
144
+ /**
145
+ * Removes a ref from the received-dedup set so a later re-advertisement of
146
+ * the same ref (e.g. the server's bootstrap heartbeat, which only re-sends
147
+ * the *latest* ref) is delivered to listeners again instead of being
148
+ * silently deduplicated.
149
+ *
150
+ * A ref is added to the dedup set the instant it is *received* — before the
151
+ * listener callback (which materializes it) has a chance to succeed. If that
152
+ * apply step fails terminally, the ref is stuck in the dedup set forever and
153
+ * the heartbeat can never heal it. Consumers whose apply failed call this so
154
+ * recovery becomes eventually-consistent rather than permanent loss.
155
+ * @param ref - The ref to allow re-delivery for.
156
+ */
157
+ invalidateReceived(ref) {
158
+ this._receivedRefsCurrent.delete(ref);
159
+ this._receivedRefsPrevious.delete(ref);
160
+ }
161
+ // ...........................................................................
144
162
  /**
145
163
  * Returns the current sequence number.
146
164
  * Only meaningful when `causalOrdering` is enabled.