Uploaded image for project: 'Realm Core'
  1. Realm Core
  2. RCORE-1304

Subscriptions on timestamps should use millisecond precision

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Sync
    • Labels:

      There is an oddity at play in that MongoDB has millisecond precision and Realm uses nanosecond precision. This means that when we receive a query from Realm on a timestamp that has non-zero nanoseconds we can't safely convert that into a MongoDB date time query in such a way that we could guarantee the same results we send is what a local realm query would return.

      I am not sure what the best route forward is, but I wanted to file a ticket to have it exist here in the hopes we can align on this at some point. This could include:
      1. Only storing millisecond prevision
      2. Only allowing queryies on millisecond precision
      3. Anything else we think of

      Error we generate:

      encountered session error in QUERY message ||| unsupported query for table [STRING]: invalid timestamp query: can't use the '<=' operator with a timestamp value with precision finer than one millisecond.  Truncate the timestamp to millisecond precision or change the query to use '<' or '>' instead.
      

      Relevant Link: https://github.com/10gen/baas/blob/b5d4ba5013c044a9da4fc4358ecd894d0cc50b6e/realm/rql/mql_convert.go#L502

            Assignee:
            Unassigned Unassigned
            Reporter:
            tyler.kaye@mongodb.com Tyler Kaye
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated: