Mailspring/spec-nylas
Ben Gotow fd8b49ea9e fix(drafts): If a draft disappears during editing, re-save instead of blowing up (Sentry 2844, more.)
Summary:
Previously, if a draft was deleted while a DraftChangeSet had uncommitted changes, it would blow up trying to find the draft.

This is bad, and can happen in normal scenarios. There are several changes in this diff:

- The DraftChangeSet no longer retrieves the draft from the database before saving changes. Instead, the save logic is in the DraftStoreProxy which already has a version of the draft kept fresh by a subscription to the DraftStore.

- The SyncbackDraftTask already had logic for POSTing when a PUT to a draft returns a 404, so no new logic was necessary there. THe new "commit" logic causes us to put back the draft that was lost, and then when we save it we detatch it from it's serverId and re-save.

In manual testing, this transparently handles the case where you delete a draft from Gmail while editing it.

Test Plan: I've added 22 tests for the DraftChangeSet and DraftStoreProxy

Reviewers: dillon, evan

Reviewed By: dillon, evan

Differential Revision: https://phab.nylas.com/D2012
2015-09-14 11:30:16 -07:00
..
components refactor(packages): Remove Edgeforce 2015-08-28 15:16:32 -04:00
fixtures fix(quoted): if whole message is quoted text, then show it 2015-09-02 18:26:58 -07:00
models fix(thread): thread.sortLabels() now ignores 'Sent Mail' and other unnecessary labels. fixes T3454. 2015-09-01 14:47:22 -07:00
stores fix(drafts): If a draft disappears during editing, re-save instead of blowing up (Sentry 2844, more.) 2015-09-14 11:30:16 -07:00
tasks feat(categories): enable creating new labels and folders. addresses T3351. 2015-09-10 10:34:09 -07:00
action-bridge-spec.coffee refactor(db): change ID system to have clientIDs and serverIDs 2015-08-28 11:24:29 -07:00
atom-spec.coffee fix(thread-list): set min-width to threadlist. fixes T3435. 2015-09-04 12:27:05 -07:00
auto-update-manager-spec.coffee updater(*): Send current platform in update check, publish to S3 in /darwin/ folder 2015-06-30 11:03:24 -07:00
buffered-process-spec.coffee fix(tests): remove unnecessary failing test 2015-06-16 09:53:27 -07:00
clipboard-spec.coffee add(specs): +101 specs and 403 assertions from Atom 2015-06-02 19:51:00 -07:00
component-registry-spec.coffee feat(*): draft icon, misc fixes, and WorkspaceStore / custom toolbar in secondary windows 2015-06-03 16:02:19 -07:00
database-object-registry-spec.coffee fix(object-serialization): Constrain use of __constructorName, fix infinite recursion, remove hackiness 2015-08-21 16:08:24 -07:00
database-view-spec.coffee feat(accounts): Kill namespaces, long live accounts 2015-08-21 15:29:58 -07:00
dom-utils-spec.coffee fix(quoted-text): new system to remove quoted text 2015-07-21 11:34:47 -07:00
launch-services-spec.coffee feat(preferences): WIP Preferences panel 2015-08-14 15:40:11 -07:00
menu-manager-spec.coffee add(specs): +101 specs and 403 assertions from Atom 2015-06-02 19:51:00 -07:00
model-view-selection-spec.coffee fix(selection): Fix issue where selecting offscreen thread (null) could break selection 2015-06-01 18:29:39 -07:00
model-view-spec.coffee refactor(utils): switch to regular underscore 2015-05-19 16:06:59 -07:00
module-cache-spec.coffee add(specs): +101 specs and 403 assertions from Atom 2015-06-02 19:51:00 -07:00
nylas-api-spec.coffee test(api): add specs for nylas api 2015-09-02 12:22:20 -07:00
nylas-protocol-handler-spec.coffee add(specs): +101 specs and 403 assertions from Atom 2015-06-02 19:51:00 -07:00
package-manager-spec.coffee refactor(models): Enables 3rd party plugins to add Models & Tasks 2015-08-19 16:25:56 -07:00
package-spec.coffee add(specs): +101 specs and 403 assertions from Atom 2015-06-02 19:51:00 -07:00
quoted-html-parser-spec.coffee fix(composer): much better specs for composer & quoted text 2015-09-03 19:41:56 -07:00
quoted-plain-text-parser-spec.coffee feat(quoted-text): New quoted text engine 2015-07-08 09:51:33 -07:00
style-manager-spec.coffee add(specs): +101 specs and 403 assertions from Atom 2015-06-02 19:51:00 -07:00
styles-element-spec.coffee add(specs): +101 specs and 403 assertions from Atom 2015-06-02 19:51:00 -07:00
test_utils.coffee fix(asar): Support ASAR, and running of specs in prod builds 2015-05-21 14:41:30 -07:00
theme-manager-spec.coffee fix(specs): silence noisy specs and fix warnings 2015-06-15 18:29:59 -07:00
undo-manager-spec.coffee fix(composer): polish composer edge cases 2015-05-19 16:12:39 -07:00
utils-spec.coffee Fixed bug where items in sent folder have "invalid date" 2015-07-31 08:23:03 -07:00