-
-
Notifications
You must be signed in to change notification settings - Fork 387
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
Collect /find Info for tree and plain types consistently #1685
Conversation
9d9622a
to
07c67ca
Compare
Pull Request Test Coverage Report for Build 8008368310Details
💛 - Coveralls |
@@ -106,7 +84,8 @@ func (t *Tree) proc(comments []store.Comment, node *Node, rd *recurData, parentI | |||
sort.Slice(node.Replies, func(i, j int) bool { | |||
return node.Replies[i].Comment.Timestamp.Before(node.Replies[j].Comment.Timestamp) | |||
}) | |||
return node, rd.tsModified, rd.tsCreated | |||
node.tsModified, node.tsCreated = rd.tsModified, rd.tsCreated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line is magic, I have no idea why it doesn't mess up tsCreated or tsModified of any of the nodes. Maybe we just don't have good enough test cases to catch it.
427e446
to
317bdad
Compare
9c146b9
to
7e5fdf0
Compare
7e5fdf0
to
676ecb2
Compare
676ecb2
to
4b0e841
Compare
4b0e841
to
11c5883
Compare
4cd4ebe
to
dc232ae
Compare
MakeTree calculated Info locally for historical reasons, and the results were consistent with the dataService.Info call but calculated differently. That change fixes that, ensuring that Info is requested in the same manner.
dc232ae
to
a6f3b7e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
makes sense
MakeTree calculated Info locally for historical reasons, and the results were consistent with the dataService.Info call but calculated differently. Requesting plain format comments, on the other hand, had a problem with not returning the read-only status of the page if it doesn't have any comments yet.
That change fixes that, ensuring that Info is requested in the same manner and the read-only status is returned correctly in case the post doesn't have comments but has such a status.