Skip to content
New issue

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

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

Already on GitHub? # to your account

Fix in-memory metadata stomping bug #637

Merged
merged 1 commit into from
Feb 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## Unreleased

- fixed: Metadata stomping bug in memory caused by new EdgeTransaction objects from the engine.
- fixed: Support the `loginServer` prop on the `MakeEdgeContext` component.

## 2.25.1 (2025-01-16)
Expand Down
10 changes: 9 additions & 1 deletion src/core/currency/wallet/currency-wallet-callbacks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,15 @@ export function makeCurrencyWalletCallbacks(

// Ensure the transaction has metadata:
const txidHash = hashStorageWalletFilename(state, walletId, txid)
if (isNew) {

// Setup the metadata in memory only if we don't have if for the
// transaction. Transaction metadata share a single file with the core,
// so we only need to do this once (regardless of whether the
// transaction is new).
// TODO: Remove this once the core is refactored to no longer depend on
// this state being in memory to get its job done for transaction
// related routines.
if (input.props.walletState.fileNames[txidHash] == null) {
setupNewTxMetadata(input, tx).catch(error =>
input.props.onError(error)
)
Expand Down
Loading