Skip to content

fix(tx-history): only consider empty timestamp and confs as unconfirmed#3327

Closed
takenagain wants to merge 2 commits intodevfrom
fix/tx-history-sorting
Closed

fix(tx-history): only consider empty timestamp and confs as unconfirmed#3327
takenagain wants to merge 2 commits intodevfrom
fix/tx-history-sorting

Conversation

@takenagain
Copy link
Copy Markdown
Contributor

@takenagain takenagain commented Oct 31, 2025

Only filters a transaction to the top as unconfirmed if both the timestamp and confirmations are 0 (timestamp = epoch).

Steps to reproduce

  1. Import a wallet with a coin with transaction history on the longer side (20+ transactions going back months to years).
  2. Activate a coin with transaction history, if not already active
  3. Open the coin details page quickly after activation
  4. Observe the transactions trickling into transaction history and confirm that they are sorted by timestamp
  5. Create a transaction by receiving to or sending funds
  6. Observe the transaction history and confirm that the newest transaction appears at the top with a Date of "Now"
  7. Wait for the transaction to be confirmed and observe the date change from "Now" to a valid timestamp for the new transaction while in the coin details page

@takenagain takenagain self-assigned this Oct 31, 2025
@takenagain takenagain added the bug Something isn't working label Oct 31, 2025
@takenagain takenagain changed the base branch from main to dev October 31, 2025 15:56
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Oct 31, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/tx-history-sorting

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@takenagain takenagain marked this pull request as ready for review October 31, 2025 16:46
Copilot AI review requested due to automatic review settings October 31, 2025 16:46
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates transaction handling to properly manage timestamps when transactions are confirmed on the blockchain. The key change ensures that pending transactions display with the correct timestamp once confirmed, rather than continuing to show "Now".

  • Updates transaction timestamp when receiving confirmed transaction data
  • Refines the logic for identifying unconfirmed transactions to check both confirmations and timestamp
  • Improves transaction sorting by distinguishing truly pending transactions from confirmed ones
Comments suppressed due to low confidence (1)

lib/bloc/transaction_history/transaction_history_bloc.dart:115

  • The timestamp is not being updated in the historical transactions handler (line 110-115), but is updated in the new transactions handler (line 190-198). This inconsistency means that historical transactions loaded from the stream won't have their timestamps updated when confirmed, only new transactions will. Add timestamp: sanitized.timestamp, to this copyWith call to maintain consistency.
                byId[sanitized.internalId] = existing.copyWith(
                  confirmations: sanitized.confirmations,
                  blockHeight: sanitized.blockHeight,
                  fee: sanitized.fee ?? existing.fee,
                  memo: sanitized.memo ?? existing.memo,
                );

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Collaborator

@smk762 smk762 left a comment

Choose a reason for hiding this comment

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

Seen working on a couple of DOGE and DASH transactions. Tendermint confirms too fast to catch, and I'm unable to test EVM at the moment as I cant see any history (might be rate limited, will retry later).

@smk762
Copy link
Copy Markdown
Collaborator

smk762 commented Nov 2, 2025

I've retried with local build, and again can not see any transaction history for any evm coins.
https://app.komodoplatform.com/wallet/matic is unaffected

@CharlVS
Copy link
Copy Markdown
Collaborator

CharlVS commented Nov 2, 2025

I've retried with local build, and again can not see any transaction history for any evm coins. https://app.komodoplatform.com/wallet/matic is unaffected

@smk762 EVM coin tx history is disabled by default in debug mode since it exhausts the Etherscan rate limits quickly. It may be better now that we have proper in-memory caching, but it'd be better to enable it after we add persistent caching.

You can disable it by commenting out:

https://github.com/KomodoPlatform/komodo-defi-sdk-flutter/blob/dev/packages/komodo_defi_sdk/lib/src/transaction_history/strategies/etherscan_transaction_history_strategy.dart#L52-L55

@CharlVS CharlVS added this to the v0.9.3 Release milestone Nov 2, 2025
CharlVS added a commit that referenced this pull request Nov 2, 2025
@smk762
Copy link
Copy Markdown
Collaborator

smk762 commented Nov 2, 2025

I've retried with local build, and again can not see any transaction history for any evm coins. https://app.komodoplatform.com/wallet/matic is unaffected

@smk762 EVM coin tx history is disabled by default in debug mode since it exhausts the Etherscan rate limits quickly. It may be better now that we have proper in-memory caching, but it'd be better to enable it after we add persistent caching.

You can disable it by commenting out:

https://github.com/KomodoPlatform/komodo-defi-sdk-flutter/blob/dev/packages/komodo_defi_sdk/lib/src/transaction_history/strategies/etherscan_transaction_history_strategy.dart#L52-L55

Built release local and I see the EVM history. After making a transaction, it did not show up in history until I navigated away and back to the page (after waiting 2 mins, and seeing 73 confirmations on explorer)

@github-actions
Copy link
Copy Markdown

github-actions bot commented Nov 3, 2025

Visit the preview URL for this PR (updated for commit 9c818b2):

https://walletrc--pull-3327-merge-9uja5frh.web.app

(expires Mon, 10 Nov 2025 07:53:38 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: f66a4ff03faa546f12f0ae5a841bd9eff2714dcc

@takenagain
Copy link
Copy Markdown
Contributor Author

Closed in favour of #3338. Revert to previous timestamp sorting, alongside a Unix epoch tweak, to avoid reliance on the confirmations field.

@takenagain takenagain closed this Nov 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants