Commit 4fe1fcde authored by Michael Gratton's avatar Michael Gratton 🤞

Replay ops that ignore remote errors should only ignore remote errors

Rename OnError.IGNORE to make it clear it is for remote errors only,
ensure only remote errors are ignored for ops that use it.
parent db9bb5f4
......@@ -42,7 +42,7 @@ private abstract class Geary.ImapEngine.ReplayOperation : Geary.BaseObject, Gee.
public enum OnError {
THROW,
RETRY,
IGNORE
IGNORE_REMOTE
}
public string name { get; set; }
......
......@@ -37,7 +37,7 @@ private class Geary.ImapEngine.ReplayQueue : Geary.BaseObject {
public CloseReplayQueue() {
// LOCAL_AND_REMOTE to make sure this operation is flushed all the way down the pipe
base ("CloseReplayQueue", ReplayOperation.Scope.LOCAL_AND_REMOTE, OnError.IGNORE);
base ("CloseReplayQueue", ReplayOperation.Scope.LOCAL_AND_REMOTE, OnError.IGNORE_REMOTE);
}
public override async ReplayOperation.Status replay_local_async()
......@@ -530,7 +530,7 @@ private class Geary.ImapEngine.ReplayQueue : Geary.BaseObject {
// If a recoverable failure and operation allows
// remote replay and not closing, re-schedule now
if (op.on_remote_error == ReplayOperation.OnError.RETRY &&
if (op.on_remote_error == RETRY &&
op.remote_retry_count <= MAX_OP_RETRIES &&
!is_unrecoverable_failure(replay_err) &&
state == State.OPEN) {
......@@ -541,15 +541,16 @@ private class Geary.ImapEngine.ReplayQueue : Geary.BaseObject {
// normalized
op.remote_retry_count++;
remote_queue.send(op);
continue;
} else if (op.on_remote_error == ReplayOperation.OnError.IGNORE) {
} else if (op.on_remote_error == IGNORE_REMOTE &&
is_remote_error(replay_err)) {
// ignoring error, simply notify as completed and continue
debug("Ignoring op %s on %s", op.to_string(), to_string());
debug("Ignoring remote error op %s on %s", op.to_string(), to_string());
} else {
debug("Throwing remote error for op %s on %s: %s", op.to_string(), to_string(),
debug("Throwing error for op %s on %s: %s", op.to_string(), to_string(),
replay_err.message);
// store for notification
remote_err = replay_err;
}
......
......@@ -82,7 +82,7 @@ private abstract class Geary.ImapEngine.AbstractListEmail : Geary.ImapEngine.Sen
public AbstractListEmail(string name, MinimalFolder owner, Geary.Email.Field required_fields,
Folder.ListFlags flags, Cancellable? cancellable) {
base(name, OnError.IGNORE);
base(name, OnError.IGNORE_REMOTE);
this.owner = owner;
this.required_fields = required_fields;
......
......@@ -22,7 +22,7 @@ private class Geary.ImapEngine.ReplayAppend : Geary.ImapEngine.ReplayOperation {
Cancellable? cancellable) {
// IGNORE remote errors because the reconnect will re-normalize the folder, making this
// append moot
base ("Append", Scope.REMOTE_ONLY, OnError.IGNORE);
base ("Append", Scope.REMOTE_ONLY, OnError.IGNORE_REMOTE);
this.owner = owner;
this.remote_count = remote_count;
......
......@@ -17,7 +17,7 @@ private class Geary.ImapEngine.ReplayRemoval : Geary.ImapEngine.ReplayOperation
public ReplayRemoval(MinimalFolder owner, int remote_count, Imap.SequenceNumber position) {
// remote error will cause folder to reconnect and re-normalize, making this remove moot
base ("Removal", Scope.LOCAL_AND_REMOTE, OnError.IGNORE);
base ("Removal", Scope.LOCAL_AND_REMOTE, OnError.IGNORE_REMOTE);
this.owner = owner;
this.remote_count = remote_count;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment