Skip to content

fix(qt): preserve visible transaction type filter - #7611

Open
PastaPastaPasta wants to merge 1 commit into
dashpay:developfrom
PastaPastaPasta:fix/qt-preserve-transaction-type-filter
Open

fix(qt): preserve visible transaction type filter#7611
PastaPastaPasta wants to merge 1 commit into
dashpay:developfrom
PastaPastaPasta:fix/qt-preserve-transaction-type-filter

Conversation

@PastaPastaPasta

Copy link
Copy Markdown
Member

Issue being fixed or feature implemented

The Qt transaction history type filter always reset to "All" or "Most Common" when the wallet model attached, even when the user had previously selected another filter such as "Data Transaction". A missing saved setting was also indistinguishable from an explicit "All" selection because QSettings::value("transactionType").toInt() defaults to 0.

What was done?

  • Use -1 as the default when no transactionType setting exists, so first-run defaults can follow CoinJoin visibility rules.
  • Stop unconditionally resetting the combo in updateCoinJoinVisibility(); only fall back when the current index is invalid or hidden.
  • Hide CoinJoin filter rows by stored filter value instead of fixed row positions.
  • Add Qt tests covering saved-filter restoration, hidden CoinJoin fallback, and the no-setting default.

How Has This Been Tested?

  • Added TransactionViewTests::transactionTypeSettingPersistence in src/qt/test/transactionviewtests.cpp.

Breaking Changes

None.

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have made corresponding changes to the documentation
  • I have assigned this pull request to a milestone

This pull request was created by Codex.

Made with Cursor

Use -1 as the default transactionType setting so first-run defaults can
differ from an explicit "All" selection, and only reset the combo when the
saved index is invalid or hidden by CoinJoin visibility.
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@github-actions

github-actions Bot commented Aug 13, 2026

Copy link
Copy Markdown

Potential PR merge conflicts

This is advisory only. It does not block CI, but it marks PRs that will likely need a rebase depending on merge order.

If this PR merges first

These open PRs will likely need a rebase:

If these PRs merge first

This PR will likely need a rebase:

@thepastaclaw

thepastaclaw commented Aug 13, 2026

Copy link
Copy Markdown

⛔ Blockers found — Opus deferred (commit e05231a)
Canonical validated blockers: 1

@coderabbitai

coderabbitai Bot commented Aug 13, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: d4f95db7-8bea-4be5-833b-47474e18de46

📥 Commits

Reviewing files that changed from the base of the PR and between ada242d and e05231a.

📒 Files selected for processing (5)
  • src/Makefile.qttest.include
  • src/qt/test/test_main.cpp
  • src/qt/test/transactionviewtests.cpp
  • src/qt/test/transactionviewtests.h
  • src/qt/transactionview.cpp

Walkthrough

The transaction view now defaults missing transaction-type settings to -1, restores selections through widget state, and updates CoinJoin filter visibility using filter data. It preserves valid selections and applies fallback selections when required. A new wallet-enabled Qt test validates persistence, invalid and CoinJoin selections, fallback behavior, and hidden CoinJoin entries. The test fixture is registered in the Qt test build and executed by the test entry point.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Mergeability Score: ⚪ Minimal · up to e0523

The change preserves the selected transaction type filter and adds coverage for saved, hidden, and unset filter states; no actionable merge-blocking risk remains after normal checks and review.

Possibly related PRs

  • dashpay/dash#7595: Both changes update CoinJoin filter visibility and add transaction-view Qt tests.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: preserving visible Qt transaction type filters.
Description check ✅ Passed The description directly explains the filter persistence fix, implementation details, tests, and lack of breaking changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@thepastaclaw thepastaclaw left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Preliminary review — Codex only

The production change correctly preserves valid visible transaction filters and applies the appropriate fallback for invalid or hidden selections. The new Qt test must acquire the wallet lock before descriptor setup to compile under CI's thread-safety warnings-as-errors configuration; the new Dash-specific test files should also be added to the non-backported registry.
Source: reviewer backend gpt-5.6-sol; final verifier backend gpt-5.6-sol. Orchestration-only: openclaw-agent/cliproxy/gpt-5.6-sol (not reviewer evidence).

Validated blockers were found in the Codex precheck. Opus is deferred until a fresh Codex revalidation clears the blocker gate.

Review provenance

  • Codex reviewers: gpt-5.6-sol — general (completed)
  • Verifier: gpt-5.6-sol — verifier
  • Sonnet: not run (deferred by blocker gate)

🔴 1 blocking | 🟡 1 suggestion(s)

🤖 Prompt for all review comments with AI agents
These findings are from an automated code review. Verify each finding against the current code and only fix it if needed.

In `src/qt/test/transactionviewtests.cpp`:
- [BLOCKING] src/qt/test/transactionviewtests.cpp:115-116: Hold cs_wallet while setting up descriptor managers
  `CWallet::SetupDescriptorScriptPubKeyMans()` is declared `EXCLUSIVE_LOCKS_REQUIRED(cs_wallet)`, and both overloads begin with `AssertLockHeld(cs_wallet)`. This call is made without holding the lock, so Clang emits a `-Wthread-safety` diagnostic; Dash CI enables both that warning and `--enable-werror`, making the Qt test fail to compile. A debug lock-order build would also abort when the test reaches this call. Existing Qt wallet tests acquire `wallet->cs_wallet` around the same setup operation.
- [SUGGESTION] src/qt/test/transactionviewtests.cpp:1: Register the new Dash-specific Qt test files
  `transactionviewtests.cpp` and `transactionviewtests.h` are newly authored Dash-specific files, but no matching entry was added to `test/util/data/non-backported.txt`. That registry supplies the file list to `test/lint/lint-cppcheck-dash.py`, so these files currently bypass the additional Dash-specific cppcheck coverage. Add `src/qt/test/transactionviewtests.*` to the registry.

Comment on lines +115 to +116
wallet->SetWalletFlag(WALLET_FLAG_DESCRIPTORS);
wallet->SetupDescriptorScriptPubKeyMans("", "");

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔴 Blocking: Hold cs_wallet while setting up descriptor managers

CWallet::SetupDescriptorScriptPubKeyMans() is declared EXCLUSIVE_LOCKS_REQUIRED(cs_wallet), and both overloads begin with AssertLockHeld(cs_wallet). This call is made without holding the lock, so Clang emits a -Wthread-safety diagnostic; Dash CI enables both that warning and --enable-werror, making the Qt test fail to compile. A debug lock-order build would also abort when the test reaches this call. Existing Qt wallet tests acquire wallet->cs_wallet around the same setup operation.

Suggested change
wallet->SetWalletFlag(WALLET_FLAG_DESCRIPTORS);
wallet->SetupDescriptorScriptPubKeyMans("", "");
wallet->SetWalletFlag(WALLET_FLAG_DESCRIPTORS);
{
LOCK(wallet->cs_wallet);
wallet->SetupDescriptorScriptPubKeyMans("", "");
}

source: ['codex']

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Addressed in 5c14ee0a3f7.

Wrapped SetupDescriptorScriptPubKeyMans("", "") in a narrow LOCK(wallet->cs_wallet) scope (same pattern as addressbooktests.cpp / wallettests.cpp). Verified with a one-shot clang++ compile using -Wthread-safety + -Werror=thread-safety-analysis (object built cleanly); negative control without the lock fails with the expected requires holding mutex 'wallet->cs_wallet' diagnostic.

@@ -0,0 +1,187 @@
// Copyright (c) 2026 The Dash Core developers

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Suggestion: Register the new Dash-specific Qt test files

transactionviewtests.cpp and transactionviewtests.h are newly authored Dash-specific files, but no matching entry was added to test/util/data/non-backported.txt. That registry supplies the file list to test/lint/lint-cppcheck-dash.py, so these files currently bypass the additional Dash-specific cppcheck coverage. Add src/qt/test/transactionviewtests.* to the registry.

source: ['codex']

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Addressed in 5c14ee0a3f7.

Added src/qt/test/transactionviewtests.* to test/util/data/non-backported.txt after the existing src/qt/* entries (before src/rpc/), matching the registry's established ordering/style.

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