add brief for functions in db, implemet full group manipulation (except owner,color), some fixes

This commit is contained in:
2026-04-01 20:13:50 +02:00
parent 81d0d19064
commit b00eff5c47
9 changed files with 150 additions and 26 deletions
+2 -2
View File
@@ -30,7 +30,7 @@ func ServeWsConnection(responseWriter http.ResponseWriter, request *http.Request
defer closeConnection(&client, ignoreCache)
for {
var clientMessage map[string]any
err := wsjson.Read(ctx, connection, &clientMessage)
err = wsjson.Read(ctx, connection, &clientMessage)
if err != nil {
log.Printf("read error: %v", err)
return
@@ -137,7 +137,6 @@ func handleUnauthenticatedMessage(ctx context.Context, client *Client, clientMes
clientFromCache, err := CacheGetClientById(clientId)
if err != nil {
// Not in cache — load from database
dbClient := &Client{Id: clientId}
err = DbSetClientByIdWithoutGroups(ctx, dbClient)
if err != nil {
@@ -162,6 +161,7 @@ func handleUnauthenticatedMessage(ctx context.Context, client *Client, clientMes
clientFromCache = dbClient
}
clientFromCache.WsConn = client.WsConn
*client = *clientFromCache
for groupId, _ := range clientFromCache.Groups {