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 issue #3163 #3250

Merged

Conversation

Haeki
Copy link

@Haeki Haeki commented Aug 28, 2024

Pre-Request Checklist

  • Passes rubocop code analysis (try rubocop --auto-correct)
  • Tests ran successful (try rake test)
  • Changes are reflected in the documentation
  • User-visible changes appended to CHANGELOG.md

Description

Current code:

If the node is running while next(node) is called, waiting.find_node_index(node) will throw an exception because the running node is not in this waiting list.
The indented behavior is a direct return from the next function.

My changes

I changed to code so that it uses the find_index() function instead, because if the node is not found there, it will simply return nil.
I also switched return unless waiting.find_index(node) to return if running.find_index(node). The running list is just the inverse of the waiting list, but it should be much shorter.
To be able to call find_index() on the running/waiting list, the function had to be moved from the private scope to the public scope.

I ran the tests and rubocop without any problems. I also tested it directly in our oxidized installation and it fixed the Web API /next returns status 500 if node is waiting to poll issue.

Closes issue #3163

@codecov-commenter
Copy link

codecov-commenter commented Aug 28, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 62.30%. Comparing base (950d4e1) to head (1e08025).
Report is 14 commits behind head on master.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3250      +/-   ##
==========================================
- Coverage   63.53%   62.30%   -1.24%     
==========================================
  Files          37       39       +2     
  Lines        1862     1955      +93     
==========================================
+ Hits         1183     1218      +35     
- Misses        679      737      +58     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@robertcheramy robertcheramy merged commit 41f098e into ytti:master Aug 30, 2024
6 of 7 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.

3 participants