Sync: Fix query.get_description() to work with unicode symbols

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Core
    • None

      Actual:

      Creating subscriptions with queries having unicode parameters causes a server error:
      query from client: "{\"Product\":\"(stringQueryField BEGINSWITH B64\\\"2KzZhdi52Kpz\\\" )\"}" could not be parsed: unsupported query for table "Product": can't use BEGINSWITH operator on a non-string constant (ProtocolErrorCode=300)
      Generated query is:

      Query:{
        "Product": "(stringQueryField BEGINSWITH B64\"2KzZhdi52Kpz\" )"
      } 

      This is because the base64 encoding in serializer.cpp: https://github.com/realm/realm-core/blob/master/src/realm/util/serializer.cpp#L116

      Expected:

      The query should be generated without base64 encoding like this:

       

       

      Query:
      {
        "Product": "(stringQueryField BEGINSWITH \"جمعتs\" )"
      } 

      Note: The issue is reproduced for queries with BEGINSWITH and CONTAINS, but it should be fixed for all the queries.

       

            Assignee:
            Jørgen Edelbo (Inactive)
            Reporter:
            Desislava Stefanova (Inactive)
            Archiver:
            Marc Greenfield

              Created:
              Updated:
              Resolved:
              Archived: