Diffdown is a real-time collaborative Markdown editor/previewer built on the AT Protocol diffdown.com

Fix: log AddCollaboration error in early-return path; use non-nil ownDocs slice

+4 -2
+4 -2
internal/handler/handler.go
··· 165 165 h.render(w, "documents.html", PageData{Title: "Documents", User: user, UserHandle: userHandle, Content: empty}) 166 166 return 167 167 } 168 - var ownDocs []*model.Document 168 + ownDocs := make([]*model.Document, 0, len(records)) 169 169 for _, rec := range records { 170 170 doc := &model.Document{} 171 171 if err := json.Unmarshal(rec.Value, doc); err != nil { ··· 682 682 // Already a collaborator — redirect to the owner-scoped URL. 683 683 for _, c := range doc.Collaborators { 684 684 if c == collabSession.DID { 685 - h.DB.AddCollaboration(collabSession.DID, invite.CreatedBy, rKey) // ensure row exists 685 + if err := h.DB.AddCollaboration(collabSession.DID, invite.CreatedBy, rKey); err != nil { 686 + log.Printf("AcceptInvite: record collaboration (existing): %v", err) 687 + } 686 688 http.Redirect(w, r, "/docs/"+invite.CreatedBy+"/"+rKey, http.StatusSeeOther) 687 689 return 688 690 }