Fix startAfter/endBefore for orderByKeys queries - #7403
Conversation
| if ([startAfterValue isKindOfClass:[NSString class]]) { | ||
| startAfterValue = [FNextPushId successor:startAfterValue]; | ||
| } |
There was a problem hiding this comment.
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.
This case is covered by validateQueryEndpointsForParams:
This is called in queryingStartingAtInternal.
schmidt-sebastian
left a comment
There was a problem hiding this comment.
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.
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.
@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 |
schmidt-sebastian
left a comment
There was a problem hiding this comment.
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.