Files
doona/mock
Zakk 4c38cfdc5b feat(groups): edit a group's exit node and explain rejected refreshes (#703)
## Problem / 问题

After #702, doona can add and edit proxy chains, but two parts of honk's
chain support are still missing. A group's experimental `exit` node can
only be set in the configuration text, and the group document from the
API does not expose it. When a subscription refresh removes or
duplicates a node that a chain hop or group exit names, honk rejects the
update and keeps the old nodes, but doona shows only a generic failure.

## How I fixed it / 解决方法

Group exit:
- `readGroupEntries` reads `exit`, and `writeGroupEntry` writes it with
`quoteName` right after `final`, the same way as `default` and `final`.
It is part of the no-change comparison and the save-conflict retry
merge.
- The group editor has an "Exit node (Experimental)" select, offered
only when the engine is honk. It lists None plus nodes that can be a
later hop, reusing the `tunnelDialable` check from #702. Chains, groups,
direct, block, Hysteria2, TUIC, Juicity and AnyTLS are excluded.
- The running-configuration section of the group dialog shows the exit
when one is set.
- honk's four group exit diagnostic codes have localized messages.

Rejected refresh:
- When a provider's `last_error.code` is `publication_rejected` and
`details.diagnostic_code` is one of the seven chain or exit codes, the
subscription status explains that a proxy chain or group exit refers to
a node the update removed or duplicated, and that the previous nodes
stay in use.

The mock `office` group gains `exit: hk-02`, which moves the mock rule
lines down by one; the rule tests follow.

## Screenshots

| | |
|---|---|
|
![](https://gist.githubusercontent.com/Zakkaus/31a26b9979ea409ca70b5dab27e07757/raw/exit-select-en-light-1280.png)
|
![](https://gist.githubusercontent.com/Zakkaus/31a26b9979ea409ca70b5dab27e07757/raw/exit-select-zh-TW-dark-390.png)
|
|
![](https://gist.githubusercontent.com/Zakkaus/31a26b9979ea409ca70b5dab27e07757/raw/exit-options-en-light-1280.png)
|
![](https://gist.githubusercontent.com/Zakkaus/31a26b9979ea409ca70b5dab27e07757/raw/exit-options-zh-TW-dark-390.png)
|
|
![](https://gist.githubusercontent.com/Zakkaus/31a26b9979ea409ca70b5dab27e07757/raw/sub-notice-en-light-1280.png)
|
![](https://gist.githubusercontent.com/Zakkaus/31a26b9979ea409ca70b5dab27e07757/raw/sub-notice-zh-TW-dark-390.png)
|
|
![](https://gist.githubusercontent.com/Zakkaus/31a26b9979ea409ca70b5dab27e07757/raw/sub-detail-en-light-1280.png)
|
![](https://gist.githubusercontent.com/Zakkaus/31a26b9979ea409ca70b5dab27e07757/raw/sub-detail-zh-TW-dark-390.png)
|

The rejected refresh shots use an intercepted providers response,
because the mock has no such provider. All 40 variants are kept locally.

## Verified / 验证

- `pnpm typecheck`, `lint`, `check:i18n`, `format:check`, `check:gen`
and `build` all exit 0.
- `pnpm test` exits 0: 251 files, 4417 tests.
- Playwright on Chromium: 12 specs covering groups, policies, rules,
nodes and the builder, 273 tests, all pass.
- `check:size`: the Policies chunk is 21055 B gzip, up 213 B. The Nodes
route is 73134 B against a 76000 B budget.
- Not yet checked against a running honk: the exit write and the real
shape of `publication_rejected`, which honk documents in api.md but
which has not been observed live.
2026-11-25 19:06:44 +11:00
..