groupware: jmap: don't collpase threads when searching for emails, and add dumping of JMAP request payloads when trace logging is enabled

This commit is contained in:
Pascal Bleser
2025-10-14 11:36:13 +02:00
parent cbe8ccebdc
commit 2787065d36
2 changed files with 9 additions and 1 deletions

View File

@@ -346,7 +346,7 @@ func (j *Client) QueryEmailsWithSnippets(accountId string, filter EmailFilterEle
AccountId: accountId,
Filter: filter,
Sort: []EmailComparator{{Property: emailSortByReceivedAt, IsAscending: false}},
CollapseThreads: true,
CollapseThreads: false,
CalculateTotal: true,
}
if offset > 0 {

View File

@@ -9,6 +9,7 @@ import (
"fmt"
"io"
"net/http"
"net/http/httputil"
"net/url"
"slices"
"strconv"
@@ -201,6 +202,13 @@ func (h *HttpJmapClient) Command(ctx context.Context, logger *log.Logger, sessio
req.Header.Add("Content-Type", "application/json")
req.Header.Add("User-Agent", h.userAgent)
if logger.Trace().Enabled() {
requestBytes, err := httputil.DumpRequestOut(req, true)
if err == nil {
logger.Trace().Str(logEndpoint, endpoint).Msg(string(requestBytes))
}
}
h.auth(session.Username, logger, req)
res, err := h.client.Do(req)