Update points if there is server-client discrepancy #4970
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.
Summary
Fixes error in points display. For exercise log sync events, only update the points display if there is a discrepancy between the points reported by the server and the points known to the client.
TODO
If not all TODOs are marked, this PR is considered WIP (work in progress)
Here's my really good reason. Testing this using selenium would take the following steps:
This is challenging because we don't provide a testing api for interacting with content nor a reliable way to determine the "state" of the page in order to avoid race conditions (e.g. polling the
#points
element too soon or not waiting long enough after a page is loaded). I also wrote a similar test that was removed. I think I can write a better, less error-prone test now in about a day. I'm on the fence as to whether that's a good use of time right now. Dear reviewer, what do you think?Issues addressed
Fixes #4643