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
Counter values don't get recalculated anymore after the whole list is loaded. #4417
Closed
7 tasks done
Labels
bug
broken functionality, usability problems, unexpected errors
state:done
meets our definition of done
state:tested
We tested it and are about to release it
Milestone
Comments
ganthern
changed the title
Fix counter values if whole list is loaded is broken
Counter values don't get recalculated anymore after the whole list is loaded.
Aug 4, 2022
ganthern
added a commit
that referenced
this issue
Aug 17, 2022
previously, list would have a callback argument that got called when it was fully loaded, which is where fixCounters was previously called. With the removal of that argument in d7a14a, it was moved to the fetch argument and called asynchronously in parallel. It contains some checks to make sure we're setting the right value on the counter, one of which caused us to almost always bail out after the sequencing change: * fetch * get new items * check if it's completely loaded and dispatch fixCounter if it is * immediately return new items to be inserted in the list. * run fixCounter, which would notice that the new items were inserted after dispatch and bail out because the list changed With this commit, we add a timestamp of the last element push/removal as a marker for list changes (better than checking the length). It would be better to create some MonitoredArray class that can track modifications instead of tracking the array and the timestamp as separate fields, but this is the easiest and certainly more performant than proxying array accesses. With this commit, the mailListView will also re-dispatch the fixCounter call if the list changed so we don't miss the chance to fix the counter. There's a potential issue where the "fully loaded" state reverts between the first and second call, but I couldn't figure out when and ifthis might happen. fix #4417
ganthern
added a commit
that referenced
this issue
Aug 17, 2022
previously, list would have a callback argument that got called when it was fully loaded, which is where fixCounters was previously called. With the removal of that argument in d7a14a, it was moved to the fetch argument and called asynchronously in parallel. It contains some checks to make sure we're setting the right value on the counter, one of which caused us to almost always bail out after the sequencing change: * fetch * get new items * check if it's completely loaded and dispatch fixCounter if it is * immediately return new items to be inserted in the list. * run fixCounter, which would notice that the new items were inserted after dispatch and bail out because the list changed With this commit, we add a timestamp of the last element push/removal as a marker for list changes (better than checking the length). It would be better to create some MonitoredArray class that can track modifications instead of tracking the array and the timestamp as separate fields, but this is the easiest and certainly more performant than proxying array accesses. With this commit, the mailListView will also re-dispatch the fixCounter call if the list changed so we don't miss the chance to fix the counter. There's a potential issue where the "fully loaded" state reverts between the first and second call, but I couldn't figure out when and ifthis might happen. fix #4417
ganthern
added a commit
that referenced
this issue
Aug 18, 2022
previously, list would have a callback argument that got called when it was fully loaded, which is where fixCounters was previously called. With the removal of that argument in d7a14a, it was moved to the fetch argument and called asynchronously in parallel. It contains some checks to make sure we're setting the right value on the counter, one of which caused us to almost always bail out after the sequencing change: * fetch * get new items * check if it's completely loaded and dispatch fixCounter if it is * immediately return new items to be inserted in the list. * run fixCounter, which would notice that the new items were inserted after dispatch and bail out because the list changed With this commit, we add a marker of the last element push/removal/replacement (better than checking the length). It would be better to create some MonitoredArray class that can track modifications instead of tracking the array and the marker as separate fields, but this is the easiest and certainly more performant than proxying array accesses. With this commit, the mailListView will also re-dispatch the fixCounter call if the list changed so we don't miss the chance to fix the counter. There's a potential issue where the "fully loaded" state reverts between the first and second call, but I couldn't figure out when and if this might happen. fix #4417 Co-authored-by: ivk <ivk@tutao.de>
charlag
added a commit
that referenced
this issue
Sep 20, 2022
previously, list would have a callback argument that got called when it was fully loaded, which is where fixCounters was previously called. With the removal of that argument in d7a14a, it was moved to the fetch argument and called asynchronously in parallel. It contains some checks to make sure we're setting the right value on the counter, one of which caused us to almost always bail out after the sequencing change: * fetch * get new items * check if it's completely loaded and dispatch fixCounter if it is * immediately return new items to be inserted in the list. * run fixCounter, which would notice that the new items were inserted after dispatch and bail out because the list changed With this commit, we add a marker of the last element push/removal/replacement (better than checking the length). It would be better to create some MonitoredArray class that can track modifications instead of tracking the array and the marker as separate fields, but this is the easiest and certainly more performant than proxying array accesses. With this commit, the mailListView will also re-dispatch the fixCounter call if the list changed so we don't miss the chance to fix the counter. There's a potential issue where the "fully loaded" state reverts between the first and second call, but I couldn't figure out when and if this might happen. fix #4417 Co-authored-by: ivk <ivk@tutao.de>
2 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
bug
broken functionality, usability problems, unexpected errors
state:done
meets our definition of done
state:tested
We tested it and are about to release it
Expect: Folder counter should be synchronized.
Hint:
Test Notes
you'll have to build a client that can set invalid mail counts (maybe expose the method that corrects it in MailListView.ts globally and build the client against the test system, call the method for the correct listId with an incorrect count and then check that the issue is fixed in the client under test.
The text was updated successfully, but these errors were encountered: