Merge pull request #398 from multica-ai/agent/lambda/df68aca8

fix(inbox): archive at issue level instead of event level
This commit is contained in:
Jiayuan Zhang 2026-04-04 00:30:04 +08:00 committed by GitHub
commit e5dfb34a2a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 51 additions and 3 deletions

View file

@ -143,10 +143,21 @@ func (h *Handler) ArchiveInboxItem(w http.ResponseWriter, r *http.Request) {
return
}
// Archive all sibling inbox items for the same issue (issue-level archive)
if item.IssueID.Valid {
h.Queries.ArchiveInboxByIssue(r.Context(), db.ArchiveInboxByIssueParams{
WorkspaceID: item.WorkspaceID,
RecipientType: item.RecipientType,
RecipientID: item.RecipientID,
IssueID: item.IssueID,
})
}
userID := requestUserID(r)
workspaceID := uuidToString(item.WorkspaceID)
h.publish(protocol.EventInboxArchived, workspaceID, "member", userID, map[string]any{
"item_id": uuidToString(item.ID),
"issue_id": uuidToPtr(item.IssueID),
"recipient_id": uuidToString(item.RecipientID),
})