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

fix: correct WebSocket path /ws/doc -> /ws/docs, remove debug logging

+1 -8
-7
internal/handler/handler.go
··· 580 580 func (h *Handler) AcceptInvite(w http.ResponseWriter, r *http.Request) { 581 581 user := h.currentUser(r) 582 582 if user == nil { 583 - log.Printf("AcceptInvite: unauthenticated, redirecting to login") 584 583 // Preserve invite token through the login redirect. 585 584 http.Redirect(w, r, "/auth/login?next="+url.QueryEscape(r.URL.String()), http.StatusSeeOther) 586 585 return ··· 588 587 589 588 rKey := r.PathValue("rkey") 590 589 inviteToken := r.URL.Query().Get("invite") 591 - log.Printf("AcceptInvite: user=%s rkey=%s token=%s", user.ID, rKey, inviteToken[:8]+"...") 592 590 if inviteToken == "" { 593 591 http.Error(w, "Invalid invite", http.StatusBadRequest) 594 592 return ··· 596 594 597 595 invite, err := collaboration.ValidateInvite(h.DB, inviteToken, rKey) 598 596 if err != nil { 599 - log.Printf("AcceptInvite: validate invite: %v", err) 600 597 http.Error(w, err.Error(), http.StatusBadRequest) 601 598 return 602 599 } 603 - log.Printf("AcceptInvite: invite valid, createdBy=%s", invite.CreatedBy) 604 600 605 601 // The collaborator's session — needed to get their DID. 606 602 collabSession, err := h.DB.GetATProtoSession(user.ID) 607 603 if err != nil || collabSession == nil { 608 - log.Printf("AcceptInvite: no ATProto session for collaborator user=%s err=%v", user.ID, err) 609 604 http.Redirect(w, r, "/auth/atproto?next="+url.QueryEscape(r.URL.String()), http.StatusSeeOther) 610 605 return 611 606 } 612 - log.Printf("AcceptInvite: collab DID=%s", collabSession.DID) 613 607 614 608 // Fetch and update the document from the OWNER's PDS, not the collaborator's. 615 609 // The invite records the owner's DID in CreatedBy. ··· 619 613 http.Error(w, "Document owner not found", http.StatusInternalServerError) 620 614 return 621 615 } 622 - log.Printf("AcceptInvite: owner user=%s", ownerUser.ID) 623 616 624 617 ownerClient, err := h.xrpcClient(ownerUser.ID) 625 618 if err != nil {
+1 -1
templates/document_edit.html
··· 516 516 if (!isCollaborator || !accessToken) return; 517 517 518 518 const protocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:'; 519 - const wsUrl = `${protocol}//${window.location.host}/ws/doc/${rkey}?access_token=${encodeURIComponent(accessToken)}&dpop_proof=placeholder`; 519 + const wsUrl = `${protocol}//${window.location.host}/ws/docs/${rkey}?access_token=${encodeURIComponent(accessToken)}&dpop_proof=placeholder`; 520 520 521 521 ws = new WebSocket(wsUrl); 522 522