fix programming evaluation polling - #7426
Merged
Merged
Conversation
adi-herwana-nus
marked this pull request as ready for review
July 10, 2024 07:21
adi-herwana-nus
force-pushed
the
adi/fix-programming-evaluation-polling
branch
from
July 17, 2024 03:38
c3bc31d to
d88d555
Compare
adi-herwana-nus
force-pushed
the
adi/fix-programming-evaluation-polling
branch
from
October 22, 2024 14:52
d88d555 to
e783da6
Compare
- polling now handled by SubmissionEditIndex component, timers started on mount and cleared on unmount - autograding job polling (from page load and "Run Code" button) moved from pollJob to component timers
adi-herwana-nus
force-pushed
the
adi/fix-programming-evaluation-polling
branch
from
October 22, 2024 14:56
e783da6 to
29e5805
Compare
cysjonathan
approved these changes
Oct 28, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes continued polling for autograding jobs on the programming submission edit page after the user navigates away (and double polling when they navigate back). Since the autograding job polling would only affect that page's UI, polling should only occur when the user is on that page.
Previous Behavior
Fetching submission details triggered a
setInterval()timer (viapollJob()helper function) to poll the backend for ongoing autograding jobs. This timer was not cleared withclearInterval()when the user navigated away, resulting in the timer being effectively orphaned.Clicking "Run Code" button also calls the
pollJob()helper function, leading to the same behavior.New Behavior
Fetching submission details no longer triggers polling automatically. Instead, polling is now managed by the
SubmissionEditIndexReact component:Both operations no longer use
pollJob()helper function. In the future, we might want to revisit whether we want to rewrite other occurrences of the function to avoid the orphan timer issue, or decide if there are some polling calls that should persist between pages.