Allow custom polling times #287
Merged
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.
Today the widget polls for members and jobs every 3 seconds. This adds some experimental configurability, and we'll use it to test different timings (2000ms and 1000ms polling)
Additions
New configurable polling time
Changes
switchMapis nowexhaustMapin our pollers, which allows a request to finish before polling again when the interval is hit. This switch 😄 was made because if the polling is too fast the widget will not parse the response before making a new request... It would get stuck permanently in a request-but-no-response loop. (I observed this locally when testing an interval time that was too fast for the server)pollMemberused to be a basic utility function, this has been moved to a React Hook. This was done so that we can test the hook's behavior WITHOUT having to run the<Connecting/>component to test the full integration. It was passing along values that it grabbed directly from state, but now it's all done with the hook directly, and the hook has many tests that cover the existing and new behavior.e2e test results
With another internal MR, this change passes existing e2e tests
Testing Instructions
When you load up the widget, pass in a value for milliseconds