aboutsummaryrefslogtreecommitdiffstats
path: root/core/module-save.c
diff options
context:
space:
mode:
Diffstat (limited to 'core/module-save.c')
-rw-r--r--core/module-save.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/core/module-save.c b/core/module-save.c
index dbf45a9..d38437f 100644
--- a/core/module-save.c
+++ b/core/module-save.c
@@ -895,12 +895,11 @@ PureResult pure_save_commit(PureApp *app, const double *values, void *const *doc
free(payload);
if (result == PURE_OK && tree) {
result = app->data.save(app->data.context, documents, document_count, drafts, count, revisions);
- /* The logged entry is on the device: taken back when the tree's commit
- * failed, or, when that may yet be stored, no save follows. */
- if (result != PURE_OK && payload_size) {
- if (result == PURE_UNCERTAIN) app->uncertain = true;
- else pure_log_retract(app->log);
- }
+ /* A commit that may yet be stored leaves the app apart from its store,
+ * whatever the save changed: no save follows until it starts again.
+ * One that failed takes back the logged entry, which is on the device. */
+ if (result == PURE_UNCERTAIN) app->uncertain = true;
+ else if (result != PURE_OK && payload_size) pure_log_retract(app->log);
}
if (result == PURE_OK) {
for (size_t k = 0; k < count; ++k)