Commit graph

10 commits

Author SHA1 Message Date
Ben Gotow 232bff4cbc Remove use of abstract base class Category in specs 2017-06-28 23:48:45 -07:00
Ben Gotow efbea58e1e Overhaul TaskFactory.tasksForApplyingCategories, fix many specs 2017-06-27 11:31:22 -07:00
Ben Gotow 6cbbd0a3dd Shorten JSON keys to save like…100mb of sqlite space 2017-06-26 23:48:55 -07:00
Ben Gotow 4966ae3650 Draft creation, saving, deletion moved to c++ 2017-06-25 00:46:01 -07:00
Ben Gotow f37aa13780 Fix double fromJSON issue 2017-06-24 12:16:05 -07:00
Ben Gotow 6aa666837e Break apart category picker into labels vs folders 2017-06-23 18:01:14 -07:00
Ben Gotow 0f6fdb4256 Fuck it - tasks don’t performLocal either 2017-06-23 14:57:52 -07:00
Ben Gotow 1219182b0a Remove clientId, serverId concept 2017-06-21 13:12:49 -07:00
Halla Moore 73e990fc05 [client-app] Don't show non-existent children on folder creation
Summary:
Previously, after creating a new folder, the UI would indicate that the new
folder had children, even though it didn't. This was caused by duplicate models
in our `MutableQueryResultSet` for the user's categories. Basically, we would
sync the server version of the folder before the `SyncbackTask` for the new
folder returned its `serverId`. Without the `serverId`, the synced version of
the folder couldn't yet be tied to the optimistic folder, so a second row was
created in the database. This second row is removed when the `syncbackTask`
does return the `serverId`, because we persist the optimistic folder with a
`REPLACE INTO` query. (This deletes other rows with the same id.) However,
since this was done inside a `persist` change with the `serverId` and no
`unpersist` was ever recorded for the `clientId`, our `MutableQueryResultSet`
never removed the `clientId` model.

To address this, this diff adds a check in `updateModel` to see if the
`serverId` is being added. If it is, and both the `serverId` and `clientId`
exist in the `_ids` list, we remove the `clientId`.

The children indicator does still briefly show up while there are still two
separate rows for that folder in the database. If we want to get rid of this
completely, we would have to ensure that we do not sync the folder before the
`syncbackTask` returns the `serverId`. However, this would probably be pretty
involved, and for not much gain. This fix is much simpler and reduces most of
the issue.

Test Plan: manual

Reviewers: juan, evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D4228
2017-03-16 12:26:42 -07:00
Evan Morikawa 9407533f51 [client-*] Rename packages folders and update readme 2017-02-16 13:31:37 -08:00