[Bps-public-commit] app-wsgetmail branch add-quiet-mode-for-cron updated. 0.08-5-gda9284d

BPS Git Server git at git.bestpractical.com
Thu Dec 7 23:01:47 UTC 2023


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "app-wsgetmail".

The branch, add-quiet-mode-for-cron has been updated
       via  da9284d758d4aa20dea15c22e76e9db90af9acce (commit)
      from  eef0d9ad0c898b8cce3023ef7fd557b60f28e78d (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit da9284d758d4aa20dea15c22e76e9db90af9acce
Author: Brian Conry <bconry at bestpractical.com>
Date:   Thu Dec 7 17:00:05 2023 -0600

    Also ignore 503 error on message delete
    
    This also seems relatively common, and also seems to be harmless.

diff --git a/lib/App/wsgetmail.pm b/lib/App/wsgetmail.pm
index 18efbbf..34be7f0 100644
--- a/lib/App/wsgetmail.pm
+++ b/lib/App/wsgetmail.pm
@@ -533,9 +533,16 @@ unknown, except that it is not related to the API limits mentioned above.
 Despite the relative rarity, if you run wsgetmail often enough you can see this
 multiple times in a typical day.
 
-Therefore, when not running in C<debug> mode, if the API call to get the mail
-folder details returns a 503 then wsgetmail will treat it as if it received a
-success response with no messages in the folder.
+Therefore, when not running in C<debug> mode, for some API calls if a 503 is
+returned wsgetmail will treat it the same as success.
+
+=over 4
+
+=item * Mail folder message listing
+
+=item * Message delete
+
+=back
 
 =head1 SEE ALSO
 
diff --git a/lib/App/wsgetmail/MS365.pm b/lib/App/wsgetmail/MS365.pm
index 182a840..2eb04d7 100644
--- a/lib/App/wsgetmail/MS365.pm
+++ b/lib/App/wsgetmail/MS365.pm
@@ -325,8 +325,18 @@ sub delete_message {
     my @path_parts = ($self->global_access) ? ('users', $self->username, 'messages', $message_id) : ('me', 'messages', $message_id);
     my $response = $self->_client->delete_request([@path_parts]);
     unless ($response->is_success) {
-        warn "failed to delete message " . $response->status_line;
-        warn "response from server : " . $response->content if $self->debug;
+        # Don't ignore 503 response when debugging.
+        if (!$self->debug and $response->code == 503) {
+            # While the exact cause and meaning of this isn't known,
+            # it seems that the messages are getting deleted because
+            # we're not seeing a lot of duplicated content from processing
+            # messages multiple times
+            $response->code( 200 );
+        }
+        else {
+            warn "failed to delete message " . $response->status_line;
+            warn "response from server : " . $response->content if $self->debug;
+        }
     }
 
     return $response;

-----------------------------------------------------------------------

Summary of changes:
 lib/App/wsgetmail.pm       | 13 ++++++++++---
 lib/App/wsgetmail/MS365.pm | 14 ++++++++++++--
 2 files changed, 22 insertions(+), 5 deletions(-)


hooks/post-receive
-- 
app-wsgetmail


More information about the Bps-public-commit mailing list