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: Checker buttons doesn't work #379

Merged
merged 1 commit into from
Mar 24, 2024
Merged

fix: Checker buttons doesn't work #379

merged 1 commit into from
Mar 24, 2024

Conversation

yammesicka
Copy link
Member

Bug that happens due to race condition.

We improved the detection too much, and it caused a race condition where the fileId etc aren't defined when we're tracking the buttons.

The solution is to define loading order using event listeners.

Bug that happens due to race condition.

We improved the <span> detection too much, and it caused a race
condition where the fileId etc aren't defined when we're tracking the
buttons.

The solution is to define loading order using event listeners.
@yammesicka yammesicka merged commit c78b736 into master Mar 24, 2024
3 checks passed
@yammesicka yammesicka deleted the fix-checker-bugs branch March 24, 2024 23:35
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 @yammesicka - I've reviewed your changes and they look great!

General suggestions:

  • Ensure that the new event names introduced are unique enough to avoid potential conflicts with existing or future code.
  • Review the overall event-driven modifications to confirm they align with the application's architecture and coding standards.
Here's what I looked at during the review
  • 🟡 General issues: 1 issue found
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Docstrings: 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.

@@ -250,6 +251,11 @@ window.addEventListener('load', () => {
sessionStorage.setItem('solverId', codeElementData.solverId);
sessionStorage.setItem('allowedComment', codeElementData.allowedComment);
customElements.define('comment-line', LineComment);
window.dispatchEvent(new Event('defined-window-variables'));
Copy link

Choose a reason for hiding this comment

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

suggestion (code_refinement): Consider the potential for event name collisions.

Using a very generic event name like 'defined-window-variables' might lead to conflicts with other scripts or future features. Consider a more specific naming convention.

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.

1 participant