Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: support skipping updates to the simulation history for clients with disabled history #4349

Merged
merged 7 commits into from
Jun 5, 2024
Merged
11 changes: 6 additions & 5 deletions packages/transaction-controller/src/TransactionController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1586,10 +1586,9 @@ export class TransactionController extends BaseController<
updateTransaction(transactionMeta: TransactionMeta, note: string) {
const { id: transactionId } = transactionMeta;

this.#updateTransactionInternal(
{ transactionId, note, skipHistory: this.isHistoryDisabled },
() => ({ ...transactionMeta }),
);
this.#updateTransactionInternal({ transactionId, note }, () => ({
...transactionMeta,
}));
}

/**
Expand Down Expand Up @@ -3650,7 +3649,9 @@ export class TransactionController extends BaseController<
updatedTransactionParams =
this.#checkIfTransactionParamsUpdated(transactionMeta);

if (skipHistory !== true) {
const shouldSkipHistory = this.isHistoryDisabled || skipHistory;

if (!shouldSkipHistory) {
transactionMeta = updateTransactionHistory(
transactionMeta,
note ?? 'Transaction updated',
Expand Down
Loading