Open Cisneiros opened 10 years ago
Can you confirm what version of WebWorks you are using?
Sorry for the Delay. I'm using the most recent one. 1.0.4.11. I've narrowed down which characters cause problems (by creating contacts with each unicode character until I got an error trying to fetch them).
The problem is if a contact's field contains a double-quote or a backslash. This is probably an escaping issue, as it can render the JSON invalid. For example, if the contact's name is Marry " Jane, the JSON would be
{
first_name: "Mary " Jane",
...
}
The same happens when the name ends on a backslash, as it escapes the last double-quote. I tried to solve this by editing the extension, but I didn't manage to do it.
Confirming my expectations, this is what happens when I inject some arbitrary JSON on the Contact Name:
Editing contact:
The contact on the Address Book:
My WebWorks app that requests the contact and prints "givenName + familyName":
@jeffheifetz Any updates on this? :)
When requesting contacts from PIM using the "find" method, on some phones, it throws a
SyntaxError: JSON Parse Error: Expected '}'
(thrown by WebWorks itself, it does not even call the onFindError callback).I've seen a similar error with extensions (issue #124), which throws the same error, and maybe this is related. I think it is some special character being returned by the Native extension that is causing this, but I cannot be sure, as I don't know which specific contact is causing this to happen (the phones it happen have hundreds or thousands of contacts).