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

Incorrect sorting behavior, first record always positioned at the end v8.0.2. #4071

Closed
heliomarpm opened this issue Nov 14, 2020 · 8 comments · Fixed by #4080
Closed

Incorrect sorting behavior, first record always positioned at the end v8.0.2. #4071

heliomarpm opened this issue Nov 14, 2020 · 8 comments · Fixed by #4080
Assignees

Comments

@heliomarpm
Copy link

heliomarpm commented Nov 14, 2020

Hello, after upgrading from v7.24.0 to v8.0.2, all the compositions are showing incorrect behavior, the first record is always being returned in the last position.

this.fireStore.doc(Users/${this.userId}) .collection<Card>('Cards', ref => ref.where('active', '==', true) .orderBy('order') .orderBy('createdAt', 'desc'));

Example:
{order: 1, condition2: 'AA' ...}
{order: 2, condition2: 'BB' ...}
{order: 3, condition2: 'AB' ...}
{order: 4, condition2: 'DD' ...}
{order: 3, condition2: 'AB' ...}

Return:
{order: 2, condition2: 'BB' ...}
{order: 3, condition2: 'AB' ...}
{order: 3, condition2: 'AB' ...}
{order: 4, condition2: 'DD' ...}
{order: 1, condition2: 'AA' ...}

@google-oss-bot
Copy link
Contributor

I found a few problems with this issue:

  • I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
  • This issue does not seem to follow the issue template. Make sure you provide all the required information.

@atsjo
Copy link

atsjo commented Nov 15, 2020

Saw similar behavior going from 8.0.1 to 8.0.2, in addition to problems propagating updates in my angular app... Downgrading to 8.0.1 fixes the problem...

@heliomarpm
Copy link
Author

Saw similar behavior going from 8.0.1 to 8.0.2, in addition to problems propagating updates in my angular app... Downgrading to 8.0.1 fixes the problem...

I am working with ionic 5 + angular. I also had a propagation problem in version 8.0.2, my solution was to go back to 8.0.0.

@wu-hui wu-hui self-assigned this Nov 16, 2020
@wu-hui
Copy link
Contributor

wu-hui commented Nov 16, 2020

I believe the issue is from angularfire, filed a issue there: angular/angularfire#2657

@wu-hui wu-hui closed this as completed Nov 16, 2020
@jamesdaniels jamesdaniels reopened this Nov 16, 2020
@jamesdaniels
Copy link
Member

If it is AngularFire it's not 2657. As developers are reporting that they started encountering it with 8.0.2 IMO it's probably the JS SDK.

@wu-hui
Copy link
Contributor

wu-hui commented Nov 16, 2020

@jamesdaniels Thanks!

@heliomarpm I tried reproduce with angularfire and could not reproduce. Can you kindly provide a mini repro? This would greatly help me identifying the root cause quicker.

@schmidt-sebastian
Copy link
Contributor

This looks like #4079

@jamesdaniels Does AngularFire use oldIndex or newIndex from DocumentChange?

@jamesdaniels
Copy link
Member

jamesdaniels commented Nov 17, 2020

@schmidt-sebastian I suspect you're right, AngularFire and RxFire use both old/newIndex: AngularFire combineChange, RxFire processIndividualChange

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants