I agree that sync and offline storage is hard to get right. We developed a whole general-purpose platform to do exactly this, in a way that also supports multiple users, decentralized publishing, offline storage, synchronizing messages, optimistic updates etc.
And unlike Firebase, Parse et al it is based on posting messages to streams that people join, rather than diffing objects. This way you can have a history of changes, and just focus on implementing the front end handlers for the changes.