Skip to content

Conversation

@nickvergessen
Copy link
Member

Before the sorting wasn't really reliable.
In case you had 2 shares with the same timestamp, you could load them in 2 different orders.
This actually broke the talk integration tests in 90% of the time (when both shares have the same timestamp) while almost always working locally because the requests took a bit long and always working while debugging because then it always was longer than 1 second for me.

Now this makes sure that sorting is always done in the same way and in case of same timestamp it sorts by id.

Copy link
Member

@rullzer rullzer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yepyepyep
good catch

@nickvergessen nickvergessen requested a review from icewind1991 June 8, 2020 13:52
Copy link
Member

@danxuliu danxuliu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code makes sense 👍

Run the affected Talk integration tests (sharing/create.feature:722 and sharing/delete.feature:216) 20 times without failures.

Nice catch!

$aTime = $a->getShareTime()->getTimestamp();
$bTime = $b->getShareTime()->getTimestamp();
if ($aTime === $bTime) {
return $a->getId() < $b->getId() ? -1 : 1;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rullzer rullzer merged commit 19712e2 into master Jun 9, 2020
@rullzer rullzer deleted the techdebt/noid/make-share-order-reliable branch June 9, 2020 08:33
@nickvergessen
Copy link
Member Author

/backport to stable19

@nickvergessen
Copy link
Member Author

Backporting to 19 so we have reliable tests there as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants