Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix 'both' filter in wallet transactions view #290

Conversation

charles-m-knox
Copy link

@charles-m-knox charles-m-knox commented Sep 11, 2024

Currently, viewing market transactions in the user's wallet will only show the sold transactions because the IsNone() check in MarketProxyService::CharGetNewTransactions defaults it to 0.

However, a value of 0 is later assumed in MarketDB::GetTransactions to be a "sold" filter (and a "buy" filter is a value of 1).

By updating the defaulted value in MarketProxyService::CharGetNewTransactions to -1 instead of 0, the wallet transactions view now works.

I also made a few minor legibility improvements in one spot in the code, nothing significant.

Summary by Sourcery

Fix the issue with the 'both' filter in the wallet transactions view by changing the default transaction type filter value to -1, ensuring both buy and sell transactions are shown. Enhance code readability with minor formatting improvements.

Bug Fixes:

  • Fix the 'both' filter in the wallet transactions view by updating the default value for transaction type filtering from 0 to -1, allowing both buy and sell transactions to be displayed correctly.

Enhancements:

  • Improve code legibility in the MarketDB and MarketProxyService by adding spacing and minor formatting adjustments.

Copy link

sourcery-ai bot commented Sep 11, 2024

Reviewer's Guide by Sourcery

This pull request fixes an issue with the 'both' filter in the wallet transactions view. The main change is updating the default value for the 'isBuy' parameter in the MarketProxyService::CharGetNewTransactions function from 0 to -1. This allows the wallet to correctly display both buy and sell transactions. Additionally, some minor code formatting improvements were made for better readability.

File-Level Changes

Change Details Files
Update default value for 'isBuy' parameter
  • Change default value of 'isBuy' from 0 to -1 when 'sellBuy' is None
  • This allows the 'both' filter to work correctly in the wallet transactions view
src/eve-server/market/MarketProxyService.cpp
Improve code readability in MarketDB::GetTransactions
  • Add blank lines between variable declarations for better separation
  • Adjust formatting of a long if statement condition for clarity
src/eve-server/market/MarketDB.cpp

Tips
  • Trigger a new Sourcery review by commenting @sourcery-ai review on the pull request.
  • Continue your discussion with Sourcery by replying directly to review comments.
  • You can change your review settings at any time by accessing your dashboard:
    • Enable or disable the Sourcery-generated pull request summary or reviewer's guide;
    • Change the review language;
  • You can always contact us if you have any questions or feedback.

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @charles-m-knox - I've reviewed your changes - here's some feedback:

Overall Comments:

  • Consider adding a brief comment explaining why -1 is used as the default value for data.isBuy in MarketProxyService::CharGetNewTransactions. This would help future maintainers understand the reasoning behind this specific value.
Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

@jdhirst
Copy link
Contributor

jdhirst commented Sep 11, 2024

Looks good to me, thanks for your contribution!

@jdhirst jdhirst merged commit 4e45b36 into EvEmu-Project:staging Sep 11, 2024
2 checks passed
@charles-m-knox charles-m-knox deleted the fix-wallet-transactions-both-filter branch September 11, 2024 12:32
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