commit 29bf4495560dc0293862fc4047b9fe23ab0153cc
parent 1cdd07d48a9c3df2ccd4acba73a9551af2855a7b
Author: Florian Dold <dold@taler.net>
Date: Fri, 27 Nov 2026 18:14:31 +0100
wallet-core: settle aborted payments and refunds from issued coins
Use change, abort and refund melts to finish the payment. Transfer
individually small remainders to one refresh and credit the refund
regardless of which refresh actually issued its coins.
Issue: https://bugs.taler.net/n/12291
Diffstat:
5 files changed, 297 insertions(+), 177 deletions(-)
diff --git a/packages/taler-wallet-core/src/db/records.ts b/packages/taler-wallet-core/src/db/records.ts
@@ -78,6 +78,8 @@ export * from "./timestamps.js";
export interface WalletTransactionAmounts {
parentTransactionId?: string;
isAbortRecovery?: boolean;
+ /** The abort attributed issued outputs from all competing melts to this refund. */
+ abortRefundSettled?: boolean;
initial?: AmountString;
final?: AmountString;
/** Face value of each consumed coin, counted once across reselections. */
diff --git a/packages/taler-wallet-core/src/pay-merchant.test.ts b/packages/taler-wallet-core/src/pay-merchant.test.ts
@@ -82,6 +82,7 @@ import {
RefundItemStatus,
RefundReason,
WalletPurchase,
+ WalletCoin,
WalletCoinSelection,
WalletRefundGroup,
WalletRefundItem,
@@ -1487,7 +1488,172 @@ for (const makeRunner of runnerFactories) {
});
}
+function refundTestWallet(
+ runWalletDbTx: WalletExecutionContext["runWalletDbTx"],
+): WalletExecutionContext {
+ return {
+ cancellationToken: CancellationToken.CONTINUE,
+ ws: {
+ networkAvailable: true,
+ addNotificationListener: () => () => {},
+ notify() {},
+ denomInfoCache: new Cache(10, Duration.fromSpec({ minutes: 1 })),
+ refreshCostCache: new Cache(10, Duration.fromSpec({ minutes: 1 })),
+ },
+ taskScheduler: { async ensureRunning() {}, startShepherdTask() {} },
+ cryptoApi: { isValidRefundConfirmation: async () => ({ valid: true }) },
+ runWalletDbTx,
+ } as unknown as WalletExecutionContext;
+}
+
+function signedRefund(
+ signPub: string,
+ coinPub: string,
+ id: number,
+ amount: AmountString,
+): MerchantCoinRefundStatus {
+ return {
+ type: "success",
+ exchange_status: 200,
+ exchange_pub: signPub,
+ exchange_sig: "receipt",
+ coin_pub: coinPub,
+ rtransaction_id: id,
+ refund_amount: amount,
+ execution_time: { t_s: 150 },
+ };
+}
+
+async function seedRefundExchange(
+ tx: WalletDbTransaction,
+ coin: WalletCoin,
+ signPub: string,
+ offered: boolean,
+) {
+ const baseUrl = coin.exchangeBaseUrl;
+ const details = makeExchangeDetails(baseUrl, coin.exchangeMasterPub);
+ const rowId = await tx.upsertExchangeDetails(details);
+ await tx.upsertExchangeSignKey(makeSignKey(rowId, signPub));
+ await tx.upsertExchange({
+ ...makeExchange(baseUrl),
+ detailsPointer: {
+ masterPublicKey: coin.exchangeMasterPub,
+ currency: "TESTKUDOS",
+ updateClock: timestampPreciseToDb({ t_s: 1 }),
+ },
+ });
+ for (const [hash, value] of [
+ [coin.denomPubHash, "TESTKUDOS:10"],
+ ["output", "TESTKUDOS:1"],
+ ] as const) {
+ const denom = makeDenomination(baseUrl, hash, {
+ stampExpireWithdraw: 4000000000,
+ });
+ denom.stampExpireLegal = denom.stampExpireDeposit =
+ denom.stampExpireWithdraw;
+ denom.value = value;
+ denom.isOffered = offered;
+ denom.fees.feeDeposit = "TESTKUDOS:0.2";
+ denom.denominationFamilySerial = await tx.upsertDenominationFamily({
+ familyParams: {
+ exchangeBaseUrl: baseUrl,
+ exchangeMasterPub: coin.exchangeMasterPub,
+ value,
+ ...denom.fees,
+ },
+ });
+ await tx.upsertDenomination(denom);
+ }
+}
+
for (const makeRunner of runnerFactories) {
+ test(`${makeRunner.name}: an undeposited reply reserves the combined remainder exactly once`, async (t) => {
+ const runner = await makeRunner();
+ t.after(() => runner.close());
+ const wex = refundTestWallet((f) => runner.runReadWriteTx(f));
+ const purchase = makeDownloadedPurchase(
+ "split-change",
+ PurchaseStatus.AbortingWithRefund,
+ );
+ const paymentId = new PayMerchantTransactionContext(
+ wex,
+ purchase.proposalId,
+ ).transactionId;
+ const coin = makeCoin("split-change");
+ purchase.payInfo!.payCoinSelection = {
+ coinPubs: [coin.coinPub],
+ coinContributions: ["TESTKUDOS:5"],
+ };
+
+ await runner.runReadWriteTx(async (tx) => {
+ await upsertTestContractTerms(tx, purchase);
+ await seedRefundExchange(tx, coin, coin.exchangeMasterPub, true);
+ await tx.upsertCoin({ ...coin, status: CoinStatus.Dormant });
+ for (const reason of [
+ RefreshReason.PayMerchant,
+ RefreshReason.AbortPay,
+ ]) {
+ const melt = recoveryRefresh(
+ reason,
+ coin.coinPub,
+ "TESTKUDOS:3.9",
+ RefreshCoinStatus.Finished,
+ "TESTKUDOS:4",
+ );
+ melt.originatingTransactionId = paymentId;
+ await tx.upsertRefreshGroup(melt);
+ if (reason === RefreshReason.AbortPay)
+ purchase.abortRefreshGroupId = melt.refreshGroupId;
+ const rest = recoveryDust(reason, coin.coinPub);
+ rest.originatingTransactionId = paymentId;
+ await tx.upsertRefreshGroup(rest);
+ }
+ await tx.upsertPurchase(purchase);
+ });
+
+ Object.assign(wex, {
+ http: {
+ async fetch(url: string) {
+ assert.ok(url.endsWith("/abort"));
+ return {
+ status: 200,
+ headers: new HeadersImpl(),
+ json: async () => ({ refunds: [{ type: "undeposited" }] }),
+ };
+ },
+ },
+ });
+ const run = () => processPurchase(wex, purchase.proposalId);
+ assert.equal((await run()).type, TaskRunResultType.Backoff);
+ assert.equal((await run()).type, TaskRunResultType.Backoff);
+ await runner.runReadWriteTx(async (tx) => {
+ const groups =
+ await tx.getRefreshGroupsByOriginatingTransaction(paymentId);
+ const pending = groups.filter(
+ (g) => g.operationStatus === RefreshOperationStatus.Pending,
+ );
+ assert.equal(pending.length, 1);
+ const [combined] = pending;
+ assert.deepEqual(combined.inputPerCoin, ["TESTKUDOS:2"]);
+ assert.equal(
+ groups.some((g) => g.paymentRecovery?.settledPerCoin[0]?.dust),
+ false,
+ );
+ // A verified zero balance cannot revive the old dust allocations.
+ combined.inputPerCoin[0] = "TESTKUDOS:0";
+ combined.statusPerCoin[0] = RefreshCoinStatus.Finished;
+ combined.operationStatus = RefreshOperationStatus.Finished;
+ combined.paymentRecovery!.settledPerCoin[0] = { melted: "TESTKUDOS:0" };
+ await tx.upsertRefreshGroup(combined);
+ });
+ assert.equal((await run()).type, TaskRunResultType.Progress);
+ assert.equal(
+ (await runner.runReadWriteTx((tx) => tx.getPurchase(purchase.proposalId)))
+ ?.purchaseStatus,
+ PurchaseStatus.FailedAbort,
+ );
+ });
+
test(`${makeRunner.name}: cumulative merchant refunds survive history deletion and restart`, async () => {
const directory = await mkdtemp(join(tmpdir(), "wallet-refund-"));
const filename = join(directory, "wallet.db");
@@ -1497,37 +1663,12 @@ for (const makeRunner of runnerFactories) {
PurchaseStatus.PendingAcceptRefund,
);
const [full, split, unknown] = ["full", "split", "unknown"].map(makeCoin);
- const baseUrl = full.exchangeBaseUrl;
const signPub = encodeCrock(new Uint8Array(32).fill(9));
- const wex = {
- ws: {
- notify() {},
- denomInfoCache: new Cache(10, Duration.fromSpec({ minutes: 1 })),
- refreshCostCache: new Cache(10, Duration.fromSpec({ minutes: 1 })),
- },
- taskScheduler: { startShepherdTask() {} },
- cryptoApi: { isValidRefundConfirmation: async () => ({ valid: true }) },
- runWalletDbTx: <T>(f: (tx: WalletDbTransaction) => Promise<T>) =>
- runner.runReadWriteTx(f),
- } as unknown as WalletExecutionContext;
+ const wex = refundTestWallet((f) => runner.runReadWriteTx(f));
const paymentId = new PayMerchantTransactionContext(
wex,
purchase.proposalId,
).transactionId;
- const success = (
- coinPub: string,
- id: number,
- amount: AmountString,
- ): MerchantCoinRefundStatus => ({
- type: "success",
- exchange_status: 200,
- exchange_pub: signPub,
- exchange_sig: "receipt",
- coin_pub: coinPub,
- rtransaction_id: id,
- refund_amount: amount,
- execution_time: { t_s: 150 },
- });
const collect = async (refunds: MerchantCoinRefundStatus[]) => {
const current = await runner.runReadWriteTx(async (tx) => {
const p = (await tx.getPurchase(purchase.proposalId))!;
@@ -1561,38 +1702,7 @@ for (const makeRunner of runnerFactories) {
await runner.runReadWriteTx(async (tx) => {
await upsertTestContractTerms(tx, purchase);
await tx.upsertPurchase(purchase);
- const details = makeExchangeDetails(baseUrl, full.exchangeMasterPub);
- const rowId = await tx.upsertExchangeDetails(details);
- await tx.upsertExchangeSignKey(makeSignKey(rowId, signPub));
- await tx.upsertExchange({
- ...makeExchange(baseUrl),
- detailsPointer: {
- masterPublicKey: full.exchangeMasterPub,
- currency: "TESTKUDOS",
- updateClock: purchase.timestamp,
- },
- });
- for (const [hash, value] of [
- [full.denomPubHash, "TESTKUDOS:10"],
- ["output", "TESTKUDOS:1"],
- ] as const) {
- const denom = makeDenomination(baseUrl, hash, {
- stampExpireWithdraw: 4000000000,
- });
- denom.stampExpireLegal = denom.stampExpireDeposit =
- denom.stampExpireWithdraw;
- denom.value = value;
- denom.fees.feeDeposit = "TESTKUDOS:0.2";
- denom.denominationFamilySerial = await tx.upsertDenominationFamily({
- familyParams: {
- exchangeBaseUrl: baseUrl,
- exchangeMasterPub: full.exchangeMasterPub,
- value,
- ...denom.fees,
- },
- });
- await tx.upsertDenomination(denom);
- }
+ await seedRefundExchange(tx, full, signPub, true);
for (const coin of [full, split, unknown]) {
await tx.upsertCoin({ ...coin, status: CoinStatus.Dormant });
}
@@ -1607,14 +1717,14 @@ for (const makeRunner of runnerFactories) {
});
}
});
- const first = success(full.coinPub, 1, "TESTKUDOS:10");
+ const first = signedRefund(signPub, full.coinPub, 1, "TESTKUDOS:10");
const firstParts = [
- success(split.coinPub, 0, "TESTKUDOS:3"),
- success(split.coinPub, 1, "TESTKUDOS:1"),
+ signedRefund(signPub, split.coinPub, 0, "TESTKUDOS:3"),
+ signedRefund(signPub, split.coinPub, 1, "TESTKUDOS:1"),
];
- const netOnly = success(unknown.coinPub, 1, "TESTKUDOS:10");
- const middle = success(split.coinPub, 2, "TESTKUDOS:2");
- const last = success(split.coinPub, 3, "TESTKUDOS:4");
+ const netOnly = signedRefund(signPub, unknown.coinPub, 1, "TESTKUDOS:10");
+ const middle = signedRefund(signPub, split.coinPub, 2, "TESTKUDOS:2");
+ const last = signedRefund(signPub, split.coinPub, 3, "TESTKUDOS:4");
await collect([first, ...firstParts, netOnly, first]);
const expected = [
[full.coinPub, "TESTKUDOS:10.1"],
@@ -1682,7 +1792,7 @@ for (const makeRunner of runnerFactories) {
await collect([last, middle, first]);
assert.deepEqual(await recoveryAmounts(), expected);
await assert.rejects(
- collect([success(split.coinPub, 4, "TESTKUDOS:1")]),
+ collect([signedRefund(signPub, split.coinPub, 4, "TESTKUDOS:1")]),
/refunds exceed their deposit/,
);
assert.deepEqual(await recoveryAmounts(), expected);
diff --git a/packages/taler-wallet-core/src/pay-merchant.ts b/packages/taler-wallet-core/src/pay-merchant.ts
@@ -24,7 +24,6 @@
/**
* Imports.
*/
-import { RefreshInput } from "./refresh-input.js";
import { validateToken } from "./tokens.js";
export { validateToken } from "./tokens.js";
import {
@@ -52,6 +51,7 @@ import {
ConfirmPayResult,
ConfirmPayResultType,
ContractTermsUtil,
+ DenominationInfo,
DownloadedContractData,
Duration,
EddsaPublicKeyString,
@@ -148,7 +148,6 @@ import {
RefundReason,
RefundGroupStatus,
RefundItemStatus,
- RefreshCoinStatus,
timestampPreciseFromDb,
timestampPreciseToDb,
timestampProtocolFromDb,
@@ -193,11 +192,16 @@ import {
classifyRecoveryRefresh,
createRefreshGroup,
getTotalRefreshCosts,
+ RecoveryRefreshOutcome,
+ restorePaymentRecoveryMelts,
+ releasePaymentRecoveryDust,
refreshCoinAgeProof,
RefreshTransactionContext,
} from "./refresh.js";
import {
accountMerchantRefunds,
+ assessMerchantAbortRecovery,
+ isMerchantRecoveryGroup,
loadAccountedRefunds,
} from "./refund-accounting.js";
import {
@@ -5714,33 +5718,13 @@ async function waitForRefreshOnAbortedPayment(
if (rec?.purchaseStatus !== PurchaseStatus.AbortingWithRefund) {
return false;
}
- if (recovery === "recovered") {
- const payCoinSelection = rec.payInfo?.payCoinSelection;
- checkDbInvariant(!!payCoinSelection, "aborting payment has no coins");
- checkDbInvariant(!!refreshGroup, "abort recovery refresh disappeared");
- const relatedRefreshes =
- await tx.getRefreshGroupsByOriginatingTransaction(ctx.transactionId);
- const refundItems: WalletRefundItem[] = [];
- const refundGroups = await tx.getRefundGroupsByProposal(rec.proposalId);
- for (const refundGroup of refundGroups) {
- refundItems.push(
- ...(await tx.getRefundItemsByGroup(refundGroup.refundGroupId)),
- );
- }
- const refreshFeesByCoin = new Map<string, AmountString>();
- const abortCoins = await tx.getCoinsByPubs(payCoinSelection.coinPubs);
- const abortDenoms = await getDenomInfos(wex, tx, abortCoins);
- for (const coin of abortCoins) {
- const denom = abortDenoms.get(denomRefKey(coin));
- checkDbInvariant(!!denom, "aborting coin has no denomination");
- refreshFeesByCoin.set(coin.coinPub, denom.feeRefresh);
- }
- const evidence = classifyMerchantAbortRecoveryEvidence(
- payCoinSelection,
+ if (refreshGroup) {
+ const evidence = await settleMerchantAbortRecovery(
+ wex,
+ tx,
+ ctx,
+ rec,
refreshGroup,
- refundItems,
- relatedRefreshes,
- refreshFeesByCoin,
);
if (evidence === "pending") {
return false;
@@ -5784,95 +5768,95 @@ async function waitForRefreshOnAbortedPayment(
return didTransition ? TaskRunResult.progress() : TaskRunResult.backoff();
}
-export function classifyMerchantAbortRecoveryEvidence(
- payCoinSelection: WalletCoinSelection,
- abortRefresh: WalletRefreshGroup,
- refundItems: WalletRefundItem[],
- relatedRefreshes: WalletRefreshGroup[],
- refreshFeesByCoin: ReadonlyMap<string, AmountString> = new Map(),
-): "recovered" | "pending" | "failed" {
- if (
- abortRefresh.oldCoinPubs.length !==
- abortRefresh.expectedOutputPerCoin.length ||
- abortRefresh.oldCoinPubs.length !== abortRefresh.statusPerCoin.length
- ) {
- return "failed";
+async function settleMerchantAbortRecovery(
+ wex: WalletExecutionContext,
+ tx: WalletDbTransaction,
+ ctx: PayMerchantTransactionContext,
+ purchase: WalletPurchase,
+ abortGroup: WalletRefreshGroup,
+): Promise<RecoveryRefreshOutcome> {
+ const selection = purchase.payInfo?.payCoinSelection;
+ checkDbInvariant(!!selection, "aborting payment has no coins");
+ const getGroups = async () => {
+ const related = await tx.getRefreshGroupsByOriginatingTransaction(
+ ctx.transactionId,
+ );
+ // A legacy root may be linked only through the purchase itself.
+ const groups = new Map([[abortGroup.refreshGroupId, abortGroup]]);
+ for (const g of related.filter(isMerchantRecoveryGroup))
+ groups.set(g.refreshGroupId, g);
+ return Array.from(groups.values());
+ };
+ const coins = await tx.getCoinsByPubs(selection.coinPubs);
+ const coinsByPub = new Map(coins.map((c) => [c.coinPub, c]));
+ const denoms = await getDenomInfos(wex, tx, coins);
+ const denomsByCoin = new Map<string, DenominationInfo>();
+ for (const coin of coins) {
+ const denom = denoms.get(denomRefKey(coin));
+ checkDbInvariant(!!denom, "aborting coin has no denomination");
+ denomsByCoin.set(coin.coinPub, denom);
}
- for (let i = 0; i < payCoinSelection.coinPubs.length; i++) {
- const coinPub = payCoinSelection.coinPubs[i];
- const abortCoinIndex = abortRefresh.oldCoinPubs.indexOf(coinPub);
- if (abortCoinIndex < 0) {
- return "failed";
- }
- const input = new RefreshInput(abortRefresh, abortCoinIndex);
- if (input.status !== RefreshCoinStatus.Finished) {
- return input.status === RefreshCoinStatus.Pending ||
- input.status === RefreshCoinStatus.PendingRedenominate
- ? "pending"
- : "failed";
- }
- const abortOutput = input.expectedOutput;
- if (!abortOutput) {
- return "failed";
- }
- if (Amounts.isNonZero(abortOutput)) {
- continue;
- }
- // Even a fully refunded contribution cannot produce new coins when the
- // denomination's refresh fee consumes all of it. Require refund proof
- // for every contribution with value above that authenticated fee.
- const refreshFee = refreshFeesByCoin.get(coinPub);
+ let groups = await getGroups();
+ let restored = false;
+ for (const group of groups) {
if (
- refreshFee &&
- Amounts.cmp(payCoinSelection.coinContributions[i], refreshFee) <= 0
- ) {
- continue;
- }
- const refundItem = refundItems.find(
- (x) =>
- x.coinPub === coinPub &&
- x.rtxid === 0 &&
- (x.status === RefundItemStatus.Done ||
- x.status === RefundItemStatus.Pending),
- );
- if (!refundItem) {
- return "failed";
- }
- if (refundItem.status === RefundItemStatus.Pending) {
- return "pending";
- }
- const refundRefresh = relatedRefreshes.find(
- (x) =>
- x.reason === RefreshReason.Refund && x.oldCoinPubs.includes(coinPub),
+ await restorePaymentRecoveryMelts(
+ wex,
+ tx,
+ group,
+ coinsByPub,
+ ctx.transactionId,
+ )
+ )
+ restored = true;
+ }
+ if (restored) groups = await getGroups();
+ const items: WalletRefundItem[] = [];
+ const refundGroups = await tx.getRefundGroupsByProposal(purchase.proposalId);
+ for (const group of refundGroups) {
+ items.push(...(await tx.getRefundItemsByGroup(group.refundGroupId)));
+ }
+ // Successful receipts survive deletion of user-visible refund history.
+ const settlement = assessMerchantAbortRecovery(
+ selection,
+ groups,
+ items,
+ denomsByCoin,
+ purchase.payInfo?.accountedRefunds ?? purchase.download?.accountedRefunds,
+ );
+ if (settlement.remainders.length) {
+ await releasePaymentRecoveryDust(
+ tx,
+ groups,
+ new Set(settlement.remainders.map((r) => r.coinPub)),
);
- if (!refundRefresh) {
- return "failed";
- }
- const refundCoinIndex = refundRefresh.oldCoinPubs.indexOf(coinPub);
- if (
- refundCoinIndex >= refundRefresh.statusPerCoin.length ||
- refundCoinIndex >= refundRefresh.expectedOutputPerCoin.length
- ) {
- return "failed";
- }
- const refundStatus = refundRefresh.statusPerCoin[refundCoinIndex];
- const refundRecovery = classifyRecoveryRefresh(
- refundRefresh.operationStatus,
+ await createRefreshGroup(
+ wex,
+ tx,
+ abortGroup.currency,
+ settlement.remainders,
+ RefreshReason.AbortPay,
+ ctx.transactionId,
+ { remainder: true },
);
- if (
- refundRecovery === "pending" ||
- refundStatus === RefreshCoinStatus.Pending
- ) {
- return "pending";
- }
- if (
- refundRecovery !== "recovered" ||
- refundStatus !== RefreshCoinStatus.Finished
- ) {
- return "failed";
+ }
+ if (settlement.outcome !== "pending") {
+ for (const refund of refundGroups) {
+ const output = settlement.refundOutputs.get(refund.refundGroupId);
+ if (!output || refund.refundReason === RefundReason.NormalRefund)
+ continue;
+ // Refund groups in older wallets inferred the reason from the purchase.
+ refund.refundReason ??= RefundReason.AbortRefund;
+ refund.amountEffective = Amounts.stringify(output);
+ (refund.transactionAmounts ??= {}).abortRefundSettled = true;
+ await tx.upsertRefundGroup(refund);
+ await new RefundTransactionContext(
+ wex,
+ refund.refundGroupId,
+ ).updateTransactionMeta(tx);
}
}
- return "recovered";
+ return settlement.outcome;
}
/**
diff --git a/packages/taler-wallet-core/src/refresh.ts b/packages/taler-wallet-core/src/refresh.ts
@@ -2276,6 +2276,26 @@ async function settleRecoveryAllocation(
}
}
+/** Transfer terminal dust allocations to one new attempt on the same coin.
+ * The enclosing wallet transaction also reserves the replacement group. */
+export async function releasePaymentRecoveryDust(
+ tx: WalletDbTransaction,
+ groups: WalletRefreshGroup[],
+ coinPubs: ReadonlySet<string>,
+): Promise<void> {
+ for (const group of groups) {
+ let changed = false;
+ for (const input of RefreshInput.all(group)) {
+ const settled = group.paymentRecovery?.settledPerCoin[input.index];
+ if (!coinPubs.has(input.coinPub) || !settled?.dust) continue;
+ delete settled.dust;
+ await settleRecoveryAllocation(tx, group, input, settled.melted);
+ changed = true;
+ }
+ if (changed) await tx.upsertRefreshGroup(group);
+ }
+}
+
/** Settle the signed melt and reserve any remainder in the same transaction as
* the issued coins. A fresh group gives the next batch its own session seed
* and keeps the original session available for recoup. */
@@ -2293,7 +2313,7 @@ async function settlePaymentRecoveryMelt(
recovery.settledPerCoin[input.index] = { melted: Amounts.stringify(melted) };
const refund =
recovery.refundGroupId && (await tx.getRefundGroup(recovery.refundGroupId));
- if (refund) {
+ if (refund && !refund.transactionAmounts?.abortRefundSettled) {
refund.amountEffective = Amounts.stringify(
Amounts.add(refund.amountEffective, input.expectedOutput).amount,
);
diff --git a/packages/taler-wallet-core/src/transaction-amounts.ts b/packages/taler-wallet-core/src/transaction-amounts.ts
@@ -248,6 +248,10 @@ async function calculate(
}
if (reason !== undefined)
a.isAbortRecovery = reason === RefundReason.AbortRefund;
+ if (a.isAbortRecovery && a.abortRefundSettled) {
+ a.final = a.initial;
+ return a;
+ }
const outputs = { ...a.refreshOutputs };
const unsettled = new Set(a.unsettledRefreshIds);
const ids = new Set([