[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ement 24e82459e9 2/4: Fix: (ement-room-mark-read) "curl
From: |
ELPA Syncer |
Subject: |
[elpa] externals/ement 24e82459e9 2/4: Fix: (ement-room-mark-read) "curl process interrupted" error |
Date: |
Thu, 27 Oct 2022 16:57:37 -0400 (EDT) |
branch: externals/ement
commit 24e82459e95a0af418a93bb61884b63d48c06bda
Author: Adam Porter <adam@alphapapa.net>
Commit: Adam Porter <adam@alphapapa.net>
Fix: (ement-room-mark-read) "curl process interrupted" error
---
README.org | 3 ++-
ement-room.el | 15 ++++++++++++---
2 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/README.org b/README.org
index d70e164afb..9f8c8199ab 100644
--- a/README.org
+++ b/README.org
@@ -289,7 +289,8 @@ Note that, while ~matrix-client~ remains usable, and
probably will for some time
** 0.4.1-pre
-Nothing new yet.
+*Fixes*
++ Don't show "curl process interrupted" message when updating a read marker's
position again.
** 0.4
diff --git a/ement-room.el b/ement-room.el
index 7e969b2f61..285c13b9e2 100644
--- a/ement-room.el
+++ b/ement-room.el
@@ -2482,7 +2482,6 @@ Also, mark room's buffer as unmodified."
;; send a new one.
(when-let ((request-process (car (map-values
ement-room-read-receipt-request))))
(when (process-live-p request-process)
- ;; FIXME: This will probably cause a spurious error message.
(interrupt-process request-process)))
(setf ement-room-read-receipt-request nil)
(setf (alist-get event ement-room-read-receipt-request)
@@ -2562,14 +2561,24 @@ Interactively, mark both types as read up to event at
point."
(let ((request-process (ement-api session endpoint :method 'post :data
(json-encode data)
:then (lambda (_data)
(ement-room-move-read-markers room
- :read-event read-event
:fully-read-event fully-read-event)))))
+ :read-event read-event
:fully-read-event fully-read-event))
+ :else (lambda (plz-error)
+ (pcase (plz-error-message plz-error)
+ ("curl process interrupted"
+ ;; Ignore this, because it happens
when we
+ ;; update a read marker before the
previous
+ ;; update request is completed.
+ nil)
+ (_ (signal 'ement-api-error
+ (list (format "Ement:
(ement-room-mark-read) Unexpected API error: %s"
+ plz-error)
+ plz-error))))))))
(when-let ((room-buffer (alist-get 'buffer (ement-room-local room))))
;; NOTE: Ideally we would do this before sending the new request,
but to make
;; the code much simpler, we do it afterward.
(with-current-buffer room-buffer
(when-let ((request-process (car (map-values
ement-room-read-receipt-request))))
(when (process-live-p request-process)
- ;; FIXME: This will probably cause a spurious error message.
(interrupt-process request-process)))
(setf ement-room-read-receipt-request nil
(alist-get read-event ement-room-read-receipt-request)
request-process)))))))