Skip to content

Conversation

@samholmes
Copy link
Contributor

@samholmes samholmes commented Dec 4, 2025

CHANGELOG

Does this branch warrant an entry to the CHANGELOG?

  • Yes
  • No

Dependencies

none

Description

none

Note

Deletes empty transaction metadata files during load and switches repo syncing to edge-sync-client’s syncRepo with deletion markers and tests.

  • Wallet metadata:
    • Add isEmptyMetadata and isEmptyTxFile; detect and delete empty transaction/*.json files during loadTxFiles.
    • New action CURRENCY_WALLET_FILE_DELETED; update files and fileNames reducers to remove deleted entries.
    • Unit tests for metadata emptiness and file deletion behavior.
  • Sync / storage:
    • Replace custom repo sync with syncClient.syncRepo; persist updated status.json.
    • Enhance encryptDisklet to support deletedDisklet for sync-aware deletions; add deletedDisklet to makeRepoPaths.
    • Update internal API syncRepo signature and imports to use edge-sync-client SyncResult.
    • Bump edge-sync-client dependency (local path) and update lockfile.
  • Docs:
    • Update CHANGELOG.md with new behavior and sync change.

Written by Cursor Bugbot for commit 840ad5a. This will update automatically on new commits. Configure here.


"currency-codes": "^1.5.1",
"disklet": "^0.5.2",
"edge-sync-client": "^0.2.8",
"edge-sync-client": "../edge-sync-client",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Local path dependency will break npm package

The edge-sync-client dependency is set to a local filesystem path "../edge-sync-client" instead of an npm version. This is development code that will break when the package is published to npm, as the relative path won't exist on consumer machines. The previous version ^0.2.8 was replaced with this local path.

Fix in Cursor Fix in Web

// eslint-disable-next-line @typescript-eslint/no-dynamic-delete
delete out[txidHash]
}
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Empty legacy files deleted at wrong path

The empty file detection and deletion logic assumes all transaction files in out are from the new transaction/ directory. However, out may contain legacy files loaded from Transactions/ directory (if no new-format file exists for that txidHash). When such a legacy file is detected as empty, the code tries to delete from transaction/${fileName} which is incorrect - the file actually exists at Transactions/${fileName}. This results in a failed deletion attempt, but the state dispatch CURRENCY_WALLET_FILE_DELETED still removes the entry from fileNames, causing state/disk inconsistency.

Fix in Cursor Fix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants