@rdlabo/ionic-angular-kit 22.0.0-beta.pr98.sha5e7e3312b58f → 22.0.0-beta.pr98.shaacd28f8ac77d

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.
@@ -3432,6 +3432,8 @@ class OfflineSyncService {
3432
3432
  throw new Error('Offline session changed before the command could be persisted');
3433
3433
  }
3434
3434
  const known = await this.#readKnownCommands(repository);
3435
+ const putCommandIds = new Set(entries.map((entry) => entry.command.commandId));
3436
+ const effectiveRemoveCommandIds = removeCommandIds?.filter((commandId) => !putCommandIds.has(commandId));
3435
3437
  const remaining = [
3436
3438
  ...known.filter((command) => !(removeCommandIds ?? []).includes(command.commandId)),
3437
3439
  ...entries.map((entry) => entry.command),
@@ -3448,7 +3450,7 @@ class OfflineSyncService {
3448
3450
  putRows: rematerialized.putRows,
3449
3451
  removeRows: rematerialized.removeRows,
3450
3452
  putCommands: entries.map((entry) => entry.command),
3451
- removeCommandIds,
3453
+ removeCommandIds: effectiveRemoveCommandIds,
3452
3454
  });
3453
3455
  await this.#refreshState(generation, repository).catch((error) => this.#reportError(error));
3454
3456
  if (options.flush !== false && this.#canSynchronize())
@@ -3679,6 +3681,12 @@ class OfflineSyncService {
3679
3681
  if (command.state === 'awaiting_pull') {
3680
3682
  return this.#commandReconciliationRemoteId(command) ?? this.#generatedRemoteId(locator, userId, generation);
3681
3683
  }
3684
+ if (command.state === 'sending') {
3685
+ const activeSend = this.#commandSendTransitions.get(this.#commandSendKey(command, generation));
3686
+ if (activeSend)
3687
+ await activeSend;
3688
+ return this.#generatedCommandOutcome(commandId, locator, generation, userId);
3689
+ }
3682
3690
  if (command.state !== 'pending')
3683
3691
  return null;
3684
3692
  const aggregate = known.filter((candidate) => this.#aggregateKey(candidate) === this.#aggregateKey(command));
@@ -3706,6 +3714,11 @@ class OfflineSyncService {
3706
3714
  for (const dirtyScope of dirtyScopes.values()) {
3707
3715
  this.#pendingPullScopes.set(this.#scopeKey(dirtyScope), dirtyScope);
3708
3716
  }
3717
+ return this.#generatedCommandOutcome(commandId, locator, generation, userId);
3718
+ }
3719
+ async #generatedCommandOutcome(commandId, locator, generation, userId) {
3720
+ if (!this.#isCurrentUser(generation, userId))
3721
+ return null;
3709
3722
  await this.#refreshState(generation);
3710
3723
  if (!this.#isCurrentUser(generation, userId))
3711
3724
  return null;