Skip to content

Commit

Permalink
jmap: skip Email/get call if no emails to get
Browse files Browse the repository at this point in the history
No need to send a JMAP request if there are no object to fetch.

Signed-off-by: Tristan Partin <[email protected]>
Acked-by: Robin Jarry <[email protected]>
Acked-by: Tim Culverhouse <[email protected]>
  • Loading branch information
tristan957 authored and rjarry committed Jun 4, 2024
1 parent 659069d commit 0465509
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions worker/jmap/fetch.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,10 @@ func (w *JMAPWorker) handleFetchMessageHeaders(msg *types.FetchMessageHeaders) e
missing = append(missing, id)
}

if len(missing) == 0 {
return nil
}

var req jmap.Request
req.Invoke(&email.Get{
Account: w.accountId,
Expand Down

0 comments on commit 0465509

Please sign in to comment.