sanity 5.24.1-next.4 → 5.24.1-next.5

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
- var version = "5.24.1-next.4+1880a07ce4";
1
+ var version = "5.24.1-next.5+ce57ece7bf";
2
2
  let buildVersion;
3
3
  try {
4
4
  buildVersion = process.env.PKG_BUILD_VERSION;
@@ -7,7 +7,7 @@ try {
7
7
  try {
8
8
  buildVersion = buildVersion || // This is replaced by `@sanity/pkg-utils` at build time
9
9
  // and must always be references by its full static name, e.g. no optional chaining, no `if (process && process.env)` etc.
10
- "5.24.1-next.4+1880a07ce4";
10
+ "5.24.1-next.5+ce57ece7bf";
11
11
  } catch {
12
12
  }
13
13
  const SANITY_VERSION = buildVersion || `${version}-dev`;
package/lib/index.js CHANGED
@@ -6105,8 +6105,9 @@ const snapshotPair = memoize((client, idPair, typeName, serverActionsEnabled, pa
6105
6105
  }), publishReplay(1), refCount());
6106
6106
  }, (ctx, idPair, typeName) => memoizeKeyGen(ctx.client, idPair, typeName)), consistencyStatus = memoize((client, idPair, typeName, serverActionsEnabled, extraOptions) => memoizedPair(client, idPair, typeName, serverActionsEnabled, extraOptions).pipe(switchMap(({
6107
6107
  draft,
6108
- published
6109
- }) => combineLatest([draft.consistency$, published.consistency$])), map(([draftIsConsistent, publishedIsConsistent]) => draftIsConsistent && publishedIsConsistent), distinctUntilChanged(), publishReplay(1), refCount()), memoizeKeyGen);
6108
+ published,
6109
+ version: version2
6110
+ }) => combineLatest([draft.consistency$, published.consistency$, version2?.consistency$ ?? of(!0)])), map(([draftIsConsistent, publishedIsConsistent, versionIsConsistent]) => draftIsConsistent && publishedIsConsistent && versionIsConsistent), distinctUntilChanged(), publishReplay(1), refCount()), memoizeKeyGen);
6110
6111
  function getOperationStoreKey(client) {
6111
6112
  const config = client.config(), {
6112
6113
  projectId,
@@ -6520,7 +6521,7 @@ const REQUIRES_CONSISTENCY = ["publish", "unpublish", "discardChanges", "delete"
6520
6521
  // should be cancelled
6521
6522
  switchMap((args) => operationArgs(ctx, args.idPair, args.typeName).pipe(take$1(1), switchMap((operationArguments) => {
6522
6523
  const requiresConsistency = REQUIRES_CONSISTENCY.includes(args.operationName);
6523
- requiresConsistency && (operationArguments.published.commit(), operationArguments.draft.commit());
6524
+ requiresConsistency && (operationArguments.published.commit(), operationArguments.draft.commit(), operationArguments.version?.commit());
6524
6525
  const isConsistent$ = consistencyStatus(ctx.client, args.idPair, args.typeName, ctx.serverActionsEnabled, ctx.extraOptions).pipe(filter(Boolean));
6525
6526
  return (requiresConsistency ? isConsistent$.pipe(take$1(1)) : of(!0)).pipe(switchMap(() => execute(args.operationName, operationArguments, args.extraArgs, operationArguments.serverActionsEnabled)));
6526
6527
  }), map(() => ({