Skip to content

fix/refactor(qt): address CodeRabbit review feedback on client_feeds#1

Open
thepastaclaw wants to merge 18 commits intokwvg:client_feedsfrom
thepastaclaw:fix/client-feeds-review-feedback
Open

fix/refactor(qt): address CodeRabbit review feedback on client_feeds#1
thepastaclaw wants to merge 18 commits intokwvg:client_feedsfrom
thepastaclaw:fix/client-feeds-review-feedback

Conversation

@thepastaclaw
Copy link

@thepastaclaw thepastaclaw commented Feb 17, 2026

Summary

Addresses all 10 code review items from the CodeRabbit review on dashpay/dash#7146.

Commits (9 total, items 9+10 combined)

# Commit Description
1 51a0b865 fix(qt): use std::atomic<bool> for m_syncing to prevent data race
2 77ffa855 fix(qt): explicitly delete m_worker in ClientFeeds::stop()
3 4aa1889c fix(qt): add m_feed_masternode->requestRefresh() on block height updates
4 c10b4f59 refactor(qt): update stale "Governance Manager" doc comment on ProposalList
5 e16bd382 refactor(qt): fix variable shadowing — rename dmnpayee in MasternodeFeed::fetch()
6 cdbbf7d1 refactor(qt): remove unused QThread forward declaration + include from masternodelist
7 669cfa84 refactor(qt): remove unused CDeterministicMNList forward declaration
8 99ecc629 refactor(qt): consolidate 3 QDialog::accepted connections into 1 lambda
9+10 9838e6fe refactor(qt): consolidate duplicate Proposals and MasternodeEntryList type aliases into clientfeeds.h

Review Items Addressed

  • ✅ Data race: m_syncingstd::atomic<bool>
  • ✅ Memory: explicit delete m_worker in stop()
  • ✅ Refresh masternode feed on new blocks
  • ✅ Stale doc comment fix
  • ✅ Variable shadowing fix
  • ✅ Remove 2 unused forward declarations
  • ✅ Consolidate duplicate accepted() signal connections
  • ✅ Consolidate duplicate type aliases

🤖 This was generated by an automated review bot.
Don't want automated PRs or comments on your code? You can opt out by replying here or messaging @PastaPastaPasta on Slack — we'll make sure the bot skips your PRs/repos going forward.

kwvg and others added 18 commits February 17, 2026 19:59
Will be needed as we start consolidating non-wallet data sourcing into a
central thread to prevent duplicated fetching.

Review with `git log -p -n1 --color-moved=dimmed_zebra --ignore-space-change`.
The current system spins up threads for each wallet instance, this is
not sustainable for clients that load a lot of wallets and is
computationally expensive for redundant fetches
Same reasoning as previous commit and we consolidate two loops while
we're at it.

Review with `git log -p -n1 --color-moved=dimmed_zebra --ignore-space-change`.
m_syncing is written by setSyncing() from the main thread and read by
requestRefresh() from the worker thread, constituting a data race on
a plain bool. Use std::atomic<bool> to make the access thread-safe.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
After quit()+wait(), the worker thread's event loop is gone, so the
deleteLater() queued via the QThread::finished connection will never
execute. Explicitly delete m_worker to prevent a memory leak.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The numBlocksChanged handler was refreshing the proposal feed but not
the masternode feed. Add m_feed_masternode->requestRefresh() so that
masternode data (e.g. next payment projections) stays current as new
blocks arrive.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The comment said "Governance Manager page widget" which is inaccurate;
ProposalList displays governance proposals, not the masternode manager.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The inner loop variable 'dmn' shadowed the outer structured binding
'dmn' from getMasternodeList(). Rename it to 'payee' to eliminate the
shadowing warning and improve readability.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…delist

The m_thread member was removed from MasternodeList, making the
QThread forward declaration and include unnecessary.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
CDeterministicMNList is not referenced in any ProposalList member
declarations or method signatures.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace three separate connect() calls from proposalCreate's accepted
signal with a single lambda that performs all three actions in order.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…sternodeEntryList

Both Proposals and MasternodeEntryList were defined in clientfeeds.h as
well as their canonical locations (proposalmodel.h and masternodemodel.h
respectively). Remove the duplicates from clientfeeds.h and include the
model headers instead, improving discoverability and single-source-of-truth.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@kwvg kwvg force-pushed the client_feeds branch 7 times, most recently from 5f71299 to 3d64056 Compare February 19, 2026 15:41
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

Comments