• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

DigitalTolk / ex / 24958799864

26 Apr 2026 02:18PM UTC coverage: 90.372% (+7.4%) from 82.96%
24958799864

push

github

web-flow
Avatar fixes (#12)

* Avatar fixes

* more tests

* fix

* fix

1283 of 1541 branches covered (83.26%)

Branch coverage included in aggregate %.

958 of 1058 new or added lines in 47 files covered. (90.55%)

1 existing line in 1 file now uncovered.

7024 of 7651 relevant lines covered (91.8%)

17.66 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

88.89
/internal/handler/thread.go
1
package handler
2

3
import (
4
        "net/http"
5

6
        "github.com/DigitalTolk/ex/internal/middleware"
7
        "github.com/DigitalTolk/ex/internal/service"
8
)
9

10
// ThreadHandler exposes endpoints that span all parents (channels and
11
// conversations) for the authenticated user.
12
type ThreadHandler struct {
13
        messageSvc *service.MessageService
14
}
15

16
// NewThreadHandler creates a ThreadHandler.
17
func NewThreadHandler(messageSvc *service.MessageService) *ThreadHandler {
4✔
18
        return &ThreadHandler{messageSvc: messageSvc}
4✔
19
}
4✔
20

21
// List returns thread summaries the authenticated user has participated in,
22
// sorted newest-activity first.
23
func (h *ThreadHandler) List(w http.ResponseWriter, r *http.Request) {
4✔
24
        userID := middleware.UserIDFromContext(r.Context())
4✔
25
        if userID == "" {
5✔
26
                writeError(w, http.StatusUnauthorized, "unauthorized", "authentication required")
1✔
27
                return
1✔
28
        }
1✔
29
        summaries, err := h.messageSvc.ListUserThreads(r.Context(), userID)
3✔
30
        if err != nil {
4✔
31
                writeError(w, http.StatusInternalServerError, "list_error", err.Error())
1✔
32
                return
1✔
33
        }
1✔
34
        if summaries == nil {
2✔
NEW
35
                summaries = []*service.ThreadSummary{}
×
NEW
36
        }
×
37
        writeJSON(w, http.StatusOK, summaries)
2✔
38
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc