@peerbit/shared-log 16.0.22 → 16.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.
@@ -543,6 +543,24 @@ export class ReplicationInfoV2SendCoordinator<R extends "u32" | "u64"> {
543
543
  });
544
544
  }
545
545
 
546
+ /**
547
+ * Read-only counterpart to {@link confirmLatestForPeer}. The target must be
548
+ * the exact current peer/transport generation and its latest local role
549
+ * revision must already have crossed the receiver's durable V2 apply lane.
550
+ */
551
+ isLatestConfirmedForPeer(target: ApplicationConfirmationTarget): boolean {
552
+ const state = this._sendStates.get(target.peerHash);
553
+ return (
554
+ state !== undefined &&
555
+ state.peerSession === target.peerSession &&
556
+ state.receiverTransportSession === target.receiverTransportSession &&
557
+ state.appliedRevision !== undefined &&
558
+ state.appliedRevision >= this._revision &&
559
+ this.isCurrent(state) &&
560
+ this.supportsApplicationConfirmation(state)
561
+ );
562
+ }
563
+
546
564
  private trackRetiringWorker(state: ReplicationInfoV2SendState): void {
547
565
  const worker = state.worker;
548
566
  if (!worker) {