Commit Graph
1 Commits
Author SHA1 Message Date
yetone 85089a2400 gui: a routing group whose plugin lists none of its models no longer blanks the Routing page; it shows as matching nothing, the rest as ever (#1585, dbydd)
The reporter's Routing page showed only "null is not an object
(evaluating 'g.members.map')" and no group, while every group still
routed. A group made of patterns only whose models a provider stops
listing (a plugin behind on updates) has no members, and Go's nil slice
went out of /api/groups as "members": null. groupRow, pickedRow, the
filter and the group editor (inGroups reads every group) all call
members.map/some/flatMap, so one such group threw out the whole list.

- groups.go: groupsState says a group's members as [] when it has none,
  and an unmakeable template's too.
- providers.go: the Gateway's group entries say icons and providers as
  [], never null (app.js gatewayModels joined g.providers).
- routing.js: every /api/groups response goes through groupsFrom, which
  makes each list a list and leaves out an entry that isn't a group;
  drawGroups draws a group that still throws as one flagged row
  ("This group can't be shown: …", zh/zh-TW/ja/de), never the whole list;
  the filter shows such a group rather than throwing.
- app.js: gatewayModels reads null icons/providers as none.

Verified: a probe through provider.SaveGroup({Match: a/m*}) then the
provider listing other models gave "members":null on main; the Go test
TestGroupsNeverNullMembers goes red with groups.go reverted (group and
3 templates null) and green with it. GUI test group-null-members.test.cjs
uses that response's literal bytes: 12/12 red on the old assets, 12/12
green now (Chromium + WebKit, en + zh, 1100 and 420 wide, plus the
Gateway list). gui-de, gui-ja, i18n-keys, group-*, panel-routing,
gateway-model-info and the routing-manual/save/provider-off tests pass
(221/221). Which plugin the reporter has was not asked; the fix covers
any provider whose models a pattern group stops matching.
2026-10-11 18:57:48 +08:00