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: using entire btag with encoded number sign for players search #224

Merged
merged 1 commit into from
Jan 1, 2025

Conversation

TeKrop
Copy link
Owner

@TeKrop TeKrop commented Jan 1, 2025

If we don't specify the entire battletag to Blizzard when searching for players, sometimes players won't be in search results even if their profile are public. It happens a lot for battletag containing very common nicknames : Arthur, Ace, etc.
The reason on Blizzard side is unknown as there isn't any obvious pagination and number of results differs between different nicknames.

When we specify the entire battletag, the profile can properly be found as expected, this is what this PR is fixing.

Summary by Sourcery

Use the entire BattleTag, including the number sign, when searching for players to ensure consistent results.

Bug Fixes:

  • Fixed an issue where players with common nicknames were not appearing in search results when searching by name only.

Enhancements:

  • Updated player search to use encoded number signs (%23) in place of dashes (-) in BattleTags.

@TeKrop TeKrop added bug Something isn't working blizzard-issue Issue coming from Blizzard (wrong data, performance issue, etc.) labels Jan 1, 2025
@TeKrop TeKrop self-assigned this Jan 1, 2025
Copy link
Contributor

sourcery-ai bot commented Jan 1, 2025

Reviewer's Guide by Sourcery

This pull request fixes an issue where players with common nicknames were not appearing in search results. The issue was caused by not specifying the full battletag when searching. This PR fixes the issue by replacing the dash in the battletag with an encoded number sign (#) before sending the search request to Blizzard.

Sequence diagram for player search with encoded battletag

sequenceDiagram
    participant Client
    participant API
    participant Blizzard

    Client->>API: Search player (battletag)
    Note over API: Replace '-' with '%23'
    API->>Blizzard: Search with encoded battletag
    Blizzard-->>API: Return player data
    API-->>Client: Return search results
Loading

File-Level Changes

Change Details Files
Use the entire battletag with encoded number sign for player search
  • Replace the dash in the player ID with an encoded number sign '%23' before constructing the Blizzard URL.
  • Use the modified player ID when searching for players on Blizzard's servers to ensure the full battletag is used in the search query.
app/players/parsers/search_data_parser.py
Version bump
  • Increment the version number from 3.8.1 to 3.8.2 in the project's configuration file to reflect the changes made in this release.
pyproject.toml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time. You can also use
    this command to specify where the summary should be inserted.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

sonarqubecloud bot commented Jan 1, 2025

Copy link
Contributor

@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 @TeKrop - I've reviewed your changes and they look great!

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 and I'll use the feedback to improve your reviews.

@TeKrop TeKrop merged commit 6871d2d into main Jan 1, 2025
4 checks passed
@TeKrop TeKrop deleted the bugfix/search-encoded-battletag-number-sign branch January 1, 2025 21:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blizzard-issue Issue coming from Blizzard (wrong data, performance issue, etc.) bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant