fix/correspondence-clock-reset-issue#3005
Merged
veloce merged 2 commits intoMay 6, 2026
Merged
Conversation
Contributor
|
Thanks for the fix and the explanation @MaartenD . I am not really sure to understand everything here, because when I did this I am pretty it was working. Anyway, I think your fix makes sense indeed. This code should be tested. This PR is a good opportunity to add tests to make sure we avoid regressions. The widget logic should be tested in a |
Contributor
Author
|
fix/correspondece-clock-reset-issue Add widget tests for CorrespondenceClock Added test/view/game/correspondence_clock_widget_test.dart with 5 tests covering the key behaviors of the CorrespondenceClock widget:
@veloce what about this set? |
3b191b3 to
3c3e4d8
Compare
Contributor
|
Thanks for this @MaartenD ; I've added more tests and an even more robust clock update detection (even if yours was fine). |
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.
The root course of this problem was the method didUpdateWidget
The if statement was
I played a 1 day correspondece game. The variable timeLeft is only reset when widget.duration changes. But after every move, the server always sends 24:00:00 — so widget.duration stays the same. Meanwhile, the internal timeLeft has already counted down during your turn.
See video how it works now.
correspondece-clock-reset-issue-small.mp4
Fixes #1955