-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Fix startAfter/endBefore for orderByKeys queries #7403
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
Conversation
if ([startAfterValue isKindOfClass:[NSString class]]) { | ||
startAfterValue = [FNextPushId successor:startAfterValue]; | ||
} |
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.
What happens when this is not true? Looks like we just call queryStartingAtInternal
with the original value, which doesn't seem to do any validation.
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 case is covered by validateQueryEndpointsForParams
:
This is called in queryingStartingAtInternal
.
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.
Thanks for updating the error message.
Can you add a Changelog entry before submitting?
@"than string in combination with queryOrderedByKey"]; | ||
format:@"Can't use queryStartingAtValue: or " | ||
@"queryStartingAfterValue: " | ||
@"with other types than string in combination with " |
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.
Might be easier to understand if it said "with non-string types when used with queryOrderedByKey:"
excludeWriteIds:@[]]; | ||
if (![node isEmpty]) { | ||
id<FNode> node = [self.serverSyncTree getServerValue:[query querySpec]]; | ||
if (node != nil && ![node isEmpty]) { |
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.
@schmidt-sebastian I'm stuck here. I can't figure out why [node isEmpty]
is needed to pass the two tests:
The equivalent is not needed for the android changes.
Coverage ReportAffected SDKs
Test Logs |
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.
I still have do debug the [node isEmpty] issue, but it looks like the SDK doesn't read from cache when it should.
We should not be passing a fallback key to startAfter if we're querying on a key index. The indexValue is the key in this case.