Skip to content
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

Fix incorrect results for sort/distinct over a link after a sort #3102

Merged
merged 3 commits into from
Oct 4, 2018

Conversation

tgoyne
Copy link
Member

@tgoyne tgoyne commented Oct 1, 2018

When a sort or distinct over links was done on an already-sorted TableView, the link translation map was done using the unsorted rows, resulting in the second sort/distinct being done with the incorrect values.

This appears to have been broken since the functionality was first introduced and is not a regression.

Reported at realm/realm-swift#5936.

@tgoyne tgoyne self-assigned this Oct 1, 2018
@tgoyne tgoyne requested a review from ironage October 1, 2018 20:17
When a sort or distinct over links was done on an already-sorted TableView, the
link translation map was done using the unsorted rows, resulting in the second
sort/distinct being done with the incorrect values.
@realm-ci
Copy link
Contributor

realm-ci commented Oct 1, 2018

Copy link
Contributor

@ironage ironage left a comment

Choose a reason for hiding this comment

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

Ok nice catch of this case!
Looks like we can't get rid of passing around the IntegerColumn so easily though because the unit tests reveal instability of stale rows across sync_if_needed.

@tgoyne
Copy link
Member Author

tgoyne commented Oct 1, 2018

I don't see any test failures related to stale rows over sync_if_needed().

@realm-ci
Copy link
Contributor

realm-ci commented Oct 1, 2018

Copy link
Contributor

@ironage ironage left a comment

Choose a reason for hiding this comment

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

Oh I was mistaken.
Nice fix 👍

@realm-ci
Copy link
Contributor

realm-ci commented Oct 4, 2018

@realm-ci
Copy link
Contributor

realm-ci commented Oct 4, 2018

@jedelbo jedelbo merged commit 2afbe26 into master Oct 4, 2018
@jedelbo jedelbo deleted the tg/distinct-over-links-after-sort branch October 4, 2018 11:09
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants