fix(clients): store client group names trimmed

The groups page lists clients.group_name as stored, while every group
action trims the name it is given. A name with surrounding white space,
saved by a node snapshot or by a client edit, was listed as a separate
group, and deleting, renaming or resetting that row acted on the real
group of the trimmed name instead.

Group names are trimmed wherever a client record is built or updated,
and a one-time seeder folds stored names onto their trimmed form.
This commit is contained in:
MHSanaei
2026-11-01 00:03:48 +01:00
parent 376ab34c0f
commit d114845e44
5 changed files with 79 additions and 3 deletions
+1 -1
View File
@@ -1288,7 +1288,7 @@ func (c *Client) ToRecord() *ClientRecord {
ExpiryTime: c.ExpiryTime,
Enable: c.Enable,
TgID: c.TgID,
Group: c.Group,
Group: strings.TrimSpace(c.Group),
Comment: c.Comment,
Reset: c.Reset,
ResetDay: c.ResetDay,