Fix overflow, diagram zoom, task-switch stall and other QA findings

This commit is contained in:
Ian Gulliver
2026-10-23 13:04:41 -07:00
parent 3da1661ca3
commit c337799147
17 changed files with 603 additions and 455 deletions
+4 -4
View File
@@ -22,9 +22,9 @@ import (
func (s *Server) ConnectClient(w http.ResponseWriter, r *http.Request) {
id := r.Header.Get("Byre-Client")
host := r.Header.Get("Byre-Host")
host := clientHost(r)
if id == "" || host == "" {
writeError(w, http.StatusBadRequest, errors.New("missing Byre-Client or Byre-Host"))
writeError(w, http.StatusBadRequest, errors.New("missing Byre-Client or Byre-Host, or Byre-Host isn't percent-encoded"))
return
}
@@ -40,9 +40,9 @@ func (s *Server) ConnectClient(w http.ResponseWriter, r *http.Request) {
func (s *Server) SetClientSync(w http.ResponseWriter, r *http.Request) {
id := r.Header.Get("Byre-Client")
host := r.Header.Get("Byre-Host")
host := clientHost(r)
if id == "" || host == "" {
writeError(w, http.StatusBadRequest, errors.New("missing Byre-Client or Byre-Host"))
writeError(w, http.StatusBadRequest, errors.New("missing Byre-Client or Byre-Host, or Byre-Host isn't percent-encoded"))
return
}
sync := api.ClientSync{}
+10 -1
View File
@@ -8,6 +8,7 @@ import (
"fmt"
"log/slog"
"net/http"
"net/url"
"os"
"path/filepath"
"strings"
@@ -202,11 +203,19 @@ func (s *Server) identify(next http.Handler) http.Handler {
}
func (s *Server) acted(login string, r *http.Request) {
if s.clients.Acted(r.Header.Get("Byre-Client"), login, r.Header.Get("Byre-Host"), r.Header.Get("Byre-Commit"), r.Header.Get("Byre-Build")) {
if s.clients.Acted(r.Header.Get("Byre-Client"), login, clientHost(r), r.Header.Get("Byre-Commit"), r.Header.Get("Byre-Build")) {
s.clientsChanged()
}
}
func clientHost(r *http.Request) string {
host, err := url.PathUnescape(r.Header.Get("Byre-Host"))
if err != nil {
return ""
}
return host
}
func (s *Server) connectedClients() []api.ConnectedClient {
out := []api.ConnectedClient{}
for _, c := range s.clients.List() {