Comments sent for a file before changing to another one may be shown in the new one #12648
Labels
0. Needs triage
Pending check for reproducibility or if it fits our roadmap
bug
feature: comments
needs info
Note that the comment is actually stored in the server in the proper file; the problem is only related to the visualization of the comment in the browser.
When opening the details view for a different file
CommentsTabView.setFileInfo
is called. Although this resets the collection and thus removes the existing models/comments,reset
does not abort the current pending requests (see pull 1325 in https://github.com/jashkenas/backbone (I am not linking it directly to prevent the reference from polluting that thread)). Thus, when the response for the creation of a new message is received it is handled in the regular way, that is, adding the model for the new comment to the collection, which causes it to be rendered in the list of comments, even if the request was originally done before the collection was reset.@nextcloud/javascript
How to test:
sleep(3)
to the beginning ofgetChild()
in apps/dav/lib/Comments/RootCollection.phpExpected result:
The No comments yet message is eventually shown
Actual result:
The first message is eventually shown, even if the current file is the second one
The text was updated successfully, but these errors were encountered: