Inconsistency in parsing timestamps for search_after

I've been fighting with pagination using search_after for dates that might be undefined.
When I sort in ascending order and the date is undefined I receive in sort property value 9223372036854775807, which I can pass as string to search_after (I have to do because of Javascript number precision issue) and receive next chunk of hits.
But when I reverse the order, I'll get -9223372036854775808 in response, which I can only pass as number not string because of parsing issue.

Why is that I can pass negative timestamp as number but not as string? How to workaround this?
Thanks for advance for tips.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.