ahmed-rivet-convex 2.2.9 → 2.2.10

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.
@@ -661,6 +661,7 @@ var PushDelegate = class extends ConnectionLoopDelegateImpl {
661
661
  import { resolver as resolver3 } from "@rocicorp/resolver";
662
662
  var MIN_DELAY_MS = 30;
663
663
  var MAX_DELAY_MS = 6e4;
664
+ var monotonicNow = () => typeof performance !== "undefined" && typeof performance.now === "function" ? performance.now() : Date.now();
664
665
  var ConnectionLoop = class {
665
666
  // ConnectionLoop runs a loop sending network requests (either pushes or
666
667
  // pulls) to the server. Our goal, generally, is to send requests as fast as
@@ -797,7 +798,7 @@ var ConnectionLoop = class {
797
798
  Math.max(delegate.minDelayMs, delay)
798
799
  );
799
800
  if (lastSendTime !== void 0) {
800
- const timeSinceLastSend = Date.now() - lastSendTime;
801
+ const timeSinceLastSend = monotonicNow() - lastSendTime;
801
802
  if (clampedDelay > timeSinceLastSend) {
802
803
  await Promise.race([
803
804
  sleepMaybeSkip(clampedDelay - timeSinceLastSend),
@@ -808,7 +809,7 @@ var ConnectionLoop = class {
808
809
  }
809
810
  counter++;
810
811
  void (async () => {
811
- const start = Date.now();
812
+ const start = monotonicNow();
812
813
  let ok;
813
814
  let error;
814
815
  try {
@@ -826,8 +827,9 @@ var ConnectionLoop = class {
826
827
  debug?.("Closed after invokeSend");
827
828
  return;
828
829
  }
829
- debug?.("Request done", { duration: Date.now() - start, ok });
830
- sendRecords.push({ duration: Date.now() - start, ok });
830
+ const duration = monotonicNow() - start;
831
+ debug?.("Request done", { duration, ok });
832
+ sendRecords.push({ duration, ok });
831
833
  if (recovered(sendRecords)) {
832
834
  recoverResolver.resolve();
833
835
  recoverResolver = resolver3();
@@ -15652,7 +15654,7 @@ function makeMessage(message, context, logLevel) {
15652
15654
  }
15653
15655
 
15654
15656
  // ../zero-client/src/client/version.ts
15655
- var version2 = "2.2.9";
15657
+ var version2 = "2.2.10";
15656
15658
 
15657
15659
  // ../zero-client/src/client/log-options.ts
15658
15660
  var LevelFilterLogSink = class {
package/dist/react.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Zero
3
- } from "./chunk-LTAG2LCD.js";
3
+ } from "./chunk-EUAHV7B3.js";
4
4
  import {
5
5
  DEFAULT_TTL_MS
6
6
  } from "./chunk-FVFX5V7B.js";
package/dist/zero.js CHANGED
@@ -6,7 +6,7 @@ import {
6
6
  number,
7
7
  string,
8
8
  table
9
- } from "./chunk-LTAG2LCD.js";
9
+ } from "./chunk-EUAHV7B3.js";
10
10
  import "./chunk-FVFX5V7B.js";
11
11
 
12
12
  // src/adapters/convex.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ahmed-rivet-convex",
3
- "version": "2.2.9",
3
+ "version": "2.2.10",
4
4
  "description": "Client-only local-first data runtime for the browser: reactive queries over IndexedDB with optimistic writes.",
5
5
  "author": "Ahmed Banihani",
6
6
  "license": "Apache-2.0",