@rocicorp/zero 0.16.2025021801 → 0.16.2025021900

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.
@@ -12008,7 +12008,8 @@ var pokeStartBodySchema = valita_exports.object({
12008
12008
  // with initial cookie `null`, before the first request. So we have to be
12009
12009
  // able to send a base cookie with value `null` to match that state.
12010
12010
  baseCookie: nullableVersionSchema,
12011
- cookie: versionSchema,
12011
+ // Deprecated: Replaced by pokeEnd.cookie.
12012
+ cookie: versionSchema.optional(),
12012
12013
  /**
12013
12014
  * This field is always set if the poke contains a `rowsPatch`.
12014
12015
  * It may be absent for patches that only update clients and queries.
@@ -12033,10 +12034,8 @@ var pokePartBodySchema = valita_exports.object({
12033
12034
  });
12034
12035
  var pokeEndBodySchema = valita_exports.object({
12035
12036
  pokeID: valita_exports.string(),
12036
- // If present, this should be the cookie stored with the client,
12037
- // instead of the cookie presented in pokeStart.
12038
- // TODO: Consider making this required and removing it from pokeStart.
12039
- cookie: versionSchema.optional(),
12037
+ // Note: This should be ignored (and may be empty) if cancel === `true`.
12038
+ cookie: versionSchema,
12040
12039
  // If `true`, the poke with id `pokeID` should be discarded without
12041
12040
  // applying it.
12042
12041
  cancel: valita_exports.boolean().optional()
@@ -12105,7 +12104,7 @@ var CRUD = "crud";
12105
12104
  var Custom = "custom";
12106
12105
 
12107
12106
  // ../zero-protocol/src/protocol-version.ts
12108
- var PROTOCOL_VERSION = 5;
12107
+ var PROTOCOL_VERSION = 6;
12109
12108
  var MIN_SERVER_SUPPORTED_SYNC_PROTOCOL = 2;
12110
12109
  assert(MIN_SERVER_SUPPORTED_SYNC_PROTOCOL < PROTOCOL_VERSION);
12111
12110
  var MIN_SERVER_SUPPORTED_PERMISSIONS_PROTOCOL = 4;
@@ -14087,7 +14086,7 @@ function makeMessage(message, context, logLevel) {
14087
14086
  }
14088
14087
 
14089
14088
  // ../zero-client/src/client/version.ts
14090
- var version2 = "0.16.2025021801";
14089
+ var version2 = "0.16.2025021900";
14091
14090
 
14092
14091
  // ../zero-client/src/client/log-options.ts
14093
14092
  var LevelFilterLogSink = class {
@@ -14870,19 +14869,19 @@ function mergePokes(pokeBuffer, schema, serverToClient2) {
14870
14869
  }
14871
14870
  const { baseCookie } = pokeBuffer[0].pokeStart;
14872
14871
  const lastPoke = pokeBuffer[pokeBuffer.length - 1];
14873
- const cookie = lastPoke.pokeEnd.cookie ?? lastPoke.pokeStart.cookie;
14872
+ const { cookie } = lastPoke.pokeEnd;
14874
14873
  const mergedPatch = [];
14875
14874
  const mergedLastMutationIDChanges = {};
14876
- let prevPokeStart = void 0;
14875
+ let prevPokeEnd = void 0;
14877
14876
  for (const pokeAccumulator of pokeBuffer) {
14878
- if (prevPokeStart && pokeAccumulator.pokeStart.baseCookie && pokeAccumulator.pokeStart.baseCookie > prevPokeStart.cookie) {
14877
+ if (prevPokeEnd && pokeAccumulator.pokeStart.baseCookie && pokeAccumulator.pokeStart.baseCookie > prevPokeEnd.cookie) {
14879
14878
  throw Error(
14880
- `unexpected cookie gap ${JSON.stringify(
14881
- prevPokeStart
14882
- )} ${JSON.stringify(pokeAccumulator.pokeStart)}`
14879
+ `unexpected cookie gap ${JSON.stringify(prevPokeEnd)} ${JSON.stringify(
14880
+ pokeAccumulator.pokeStart
14881
+ )}`
14883
14882
  );
14884
14883
  }
14885
- prevPokeStart = pokeAccumulator.pokeStart;
14884
+ prevPokeEnd = pokeAccumulator.pokeEnd;
14886
14885
  for (const pokePart of pokeAccumulator.parts) {
14887
14886
  if (pokePart.lastMutationIDChanges) {
14888
14887
  for (const [clientID, lastMutationID] of Object.entries(
@@ -16250,4 +16249,4 @@ export {
16250
16249
  escapeLike,
16251
16250
  Zero
16252
16251
  };
16253
- //# sourceMappingURL=chunk-X7ACPYAD.js.map
16252
+ //# sourceMappingURL=chunk-A5B7QS5J.js.map