mozilla-b2g/gaia — pull request #19394 by sergi (2014-05-19 18:15:39+00:00)
Title: Bug 1007573 - [Tarako][Contacts]After merge contact or add contact to my favorite, cannot edit

I believe the problem here was that IndexedDB (through AsyncStorage) tries to store an object that contains not only JS data structures, but native ones as well, such as possibly some XPCOM wrappers. At that point, it crashes.

My fix stores the stringified contact object, and that solves the problem. Whenever a 'draft' is detected in the DB upon opening the contacts app, that string is parsed.

I got the insight from https://bugzilla.mozilla.org/show_bug.cgi?id=930839#c7