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

fixed issue at start-up with search data retrieval #223

Merged
merged 1 commit into from
Dec 15, 2024

Conversation

TeKrop
Copy link
Owner

@TeKrop TeKrop commented Dec 15, 2024

Summary by Sourcery

Fix search data retrieval issue at startup by enhancing error handling and updating test fixtures. Update project version to 3.8.1.

Bug Fixes:

  • Fix issue with search data retrieval at startup by handling KeyError and TypeError exceptions.

Enhancements:

  • Improve error handling in search data transformation by logging exceptions and sending notifications via Discord webhook.

Tests:

  • Update test fixtures and player IDs to reflect changes in player profiles and data.

Chores:

  • Update project version from 3.8.0 to 3.8.1 in pyproject.toml.

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

sourcery-ai bot commented Dec 15, 2024

Reviewer's Guide by Sourcery

This pull request fixes an issue with search data retrieval at startup by adding error handling for missing or malformed data and updating test fixtures.

Sequence diagram for error handling in search data retrieval

sequenceDiagram
    participant Client
    participant Server
    participant Logger
    participant DiscordWebhook

    Client->>Server: Request search data
    Server->>Server: transform_search_data()
    alt Data is valid
        Server-->>Client: Return transformed data
    else Data is missing or malformed
        Server->>Logger: Log exception
        Server->>DiscordWebhook: Send error message
        Server-->>Client: Return empty string
    end
Loading

File-Level Changes

Change Details Files
Added error handling for search data retrieval
  • Added try-except block around data type value extraction
  • Added error logging and Discord webhook notification on failure
  • Return empty string as fallback when data is missing or malformed
app/players/commands/update_search_data_cache.py
Updated test fixtures and configuration
  • Updated test player ID from KIRIKO-21253 to KIRIKO-12460
  • Removed outdated test fixture file
  • Updated version number to 3.8.1
tests/helpers.py
tests/fixtures/html/players/KIRIKO-21253.html
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

sonarcloud bot commented Dec 15, 2024

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 - here's some feedback:

Overall Comments:

  • Consider adding a comment explaining why an empty string was chosen as the fallback value when data is missing or invalid
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 f21bbf0 into main Dec 15, 2024
4 checks passed
@TeKrop TeKrop deleted the bugfix/load-search-data branch December 15, 2024 09:17
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