history: preserve description edits during refresh by eightjean · Pull Request #319 · feather-wallet/feather · GitHub
Skip to content

history: preserve description edits during refresh - #319

Open
eightjean wants to merge 1 commit into
feather-wallet:masterfrom
eightjean:fix/issue-144-history-edit-reset
Open

eightjean wants to merge 1 commit into
feather-wallet:masterfrom
eightjean:fix/issue-144-history-edit-reset

Conversation

@eightjean

Copy link
Copy Markdown

Editing a transaction's description in History is aborted, and the typed text lost, whenever the history refreshes (#144). Once synchronized, Wallet::onNewBlock and Wallet::onUpdated call TransactionHistory::refresh() on every block and on every received or sent payment, and refresh() resets the model (refreshStarted/refreshFinished are connected to beginResetModel/endResetModel), which closes the open editor without committing it. This is the same kind of problem c5aef15 solved for the Receive tab.

refresh() now builds the new rows first and, for the same account, reconciles them with the current list instead of resetting:

  • existing rows are matched by txid, direction, account and subaddress indices (a txid can have several rows), replaced in place, and announced with one dataChanged for the Date–TxID and Amount columns. Description gets a dataChanged only on rows whose description changed, so an open editor keeps its text;
  • rows that are gone (a failed transaction removed, a reorg) are removed with beginRemoveRows/endRemoveRows, and new transactions are appended with beginInsertRows/endInsertRows; the proxy keeps sorting and filtering them as before;
  • switching accounts still resets the model.

setData no longer emits its own dataChanged: committing a description calls refresh(), which now reports the changed description cell.

Fixes #144

Testing: built in a Linux container with the CI's Ubuntu 24.04 steps (cmake -DWITH_SCANNER=OFF .. && cmake --build . -j $(nproc)). Reproduced on a local regtest node (monerod --regtest --offline, v0.18.5.4) with Feather under Xvfb: with an incoming transaction at one confirmation, start editing its description, type text, then mine a block (and, separately, receive a new transaction) before pressing Return, and read the stored note from the wallet after quitting. Without the change the text is lost in both cases (the stored note is empty); with it the text is kept and stored, and the confirmations shown go from 1 to 2 to 3. Pending-to-confirmed, failed transaction removal, reorgs, several rows per txid and large histories follow from the code but were not run.

Prepared with AI assistance.

🤖 Generated with Claude Code

Update existing transaction rows and insert or remove rows as history
changes instead of resetting the model. Batch status and amount updates
without touching an unchanged description editor.

Keep model resets when switching accounts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

editing a transaction description aborted when displayed history changes

1 participant