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 queries.py Line 119-123 #86

Merged
merged 1 commit into from
Sep 29, 2024
Merged

Conversation

Shi-Soul
Copy link
Contributor

@Shi-Soul Shi-Soul commented Sep 29, 2024

Fix a simple Operator precedence bug.

browserEvents(params)
if isDesktopParams(params)
else ""
+ (...)

In this code, ""+(...) will be interpreted as a whole.


Important

Fix operator precedence issue in canonicalEvents() in queries.py by adding parentheses for correct string concatenation.

  • Bug Fix:
    • Fix operator precedence issue in canonicalEvents() in queries.py.
    • Add parentheses around browserEvents(params) if isDesktopParams(params) else "" to ensure correct string concatenation order.

This description was created by Ellipsis for 3c7aa33. It will automatically update as commits are pushed.

Fix a simple Operator precedence bug.
Copy link

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Reviewed everything up to 3c7aa33 in 5 seconds

More details
  • Looked at 19 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. aw_client/queries.py:119
  • Draft comment:
    The fix correctly addresses the operator precedence issue by adding parentheses. However, the nested parentheses can be simplified for better readability:
browserEvents(params) if isDesktopParams(params) else ""
  • Reason this comment was not posted:
    Confidence changes required: 10%
    The PR correctly addresses the operator precedence issue by adding parentheses around the conditional expression. This ensures that the concatenation operation is performed correctly. However, there is a potential improvement in readability by simplifying the nested parentheses.

Workflow ID: wflow_BW1MMHKjCTviMVAD


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

@ErikBjare
Copy link
Member

Thanks, nice catch!

Merging.

@ErikBjare ErikBjare merged commit 292b235 into ActivityWatch:master Sep 29, 2024
4 of 6 checks passed
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