diff --git a/CHANGELOG.md b/CHANGELOG.md index b71f831..521dd18 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +- Filter scoped administration lists row by row so a change of group or channel within a notification cannot mix permissions from different targets. + - The connected nickname editor starts with the current name and stays open on server refusal. It uses the core's nickname validation and closes after an acknowledged change. - Channel disclosure now remembers hidden participants per server address after restart. Collapsing a channel leaves its subchannels visible. diff --git a/core/src/admin.rs b/core/src/admin.rs index 4682c74..e46cc31 100644 --- a/core/src/admin.rs +++ b/core/src/admin.rs @@ -674,8 +674,7 @@ pub(crate) fn validate(command: &AdminCommand) -> Result<(), ErrorObj> { #[derive(Debug)] pub enum Reply { Ack, - /// Rows of `notify` collected until the command result; `key` filters rows by the first - /// entry's id (list notifications carry it there only). + /// Rows without an explicit scope inherit the last scope in this reply. Rows { notify: &'static str, key: Option<(&'static str, String)>, rows: Vec, overflow: bool, accept: bool }, /// Only an unambiguous creation by our client under the requested parent identifies the new channel. Created { name: String, parent: u64, invoker: u16, channel_id: Option, ambiguous: bool }, @@ -710,17 +709,11 @@ impl Reply { pub fn collect(&mut self, raw: &RawNotification) { match self { Reply::Rows { notify, key, rows, overflow, accept } if *notify == raw.name => { - // A continuation without the id belongs to the previous accepted notification. - if let Some((k, v)) = key { - match raw.items.first().and_then(|i| i.get(*k)) { - Some(id) => *accept = id == v, - None => {} - } - } else { - *accept = true; - } - if !*accept { return; } for row in &raw.items { + if let Some((k, v)) = key { + if let Some(id) = row.get(*k) { *accept = id == v; } + if !*accept { continue; } + } if rows.len() >= MAX_ROWS { *overflow = true; return; } rows.push(row.clone()); } @@ -1178,6 +1171,19 @@ mod tests { assert_eq!(finish(r).unwrap(), json!({"description":""})); } + #[test] + fn permission_rows_follow_each_explicit_scope_across_packet_boundaries() { + let mut reply = Reply::rows("notifyservergrouppermlist", Some(("sgid", 6))); + for packet in [ + "notifyservergrouppermlist permid=1|sgid=7 permid=2|sgid=6 permid=3|permid=4|sgid=7 permid=5", + "notifyservergrouppermlist permid=6|sgid=6 permid=7", + "notifyservergrouppermlist permid=8", + ] { reply.collect(&crate::rawcmd::parse(packet.as_bytes()).unwrap()); } + let value = finish(reply).unwrap(); + let ids: Vec<_> = value["rows"].as_array().unwrap().iter().map(|row| row["permid"].as_str().unwrap()).collect(); + assert_eq!(ids, ["3", "4", "7", "8"]); + } + #[test] fn replies_collect_only_their_rows() { let mut r = Reply::rows("notifyservergrouppermlist", Some(("sgid", 6))); diff --git a/docs/bridge.md b/docs/bridge.md index 9407467..c7a200f 100644 --- a/docs/bridge.md +++ b/docs/bridge.md @@ -659,6 +659,8 @@ Regression requirements include approved-destination persistence, rejected UI pa Every mutation below is answered only after its real server command result. Permission hints never manufacture success. Requests capture a server connection ID in native service and its native `generation`; stale mutations fail. Read replies are `{rows:[wire-key/string-value objects]}`, not HTML. Only one reader per notification type is allowed in flight; over 10,000 rows fails rather than silently truncating. Empty database/permission-list replies become empty rows. +For a scoped list, each explicit scope ID applies from that row onward, including across packet boundaries. Rows before the first scope ID and rows belonging to a different scope are excluded. + `admin_context {}` returns `{generation,server_uid,own_client_id,catalog_received,permissions,permissions_catalog,permission_error?}`. Permissions are the official named hint values (null if unknown); catalog entries are `{id,name,description}`. For an isolated Windows beta14 fixture at `127.0.0.1:19987`, set `TEAMSPEACH_QA_CORE` to the absolute diagnostic core executable and run `cargo run --locked -p teamspeach-core --example channel_admin_qa`. It checks a newly created temporary channel, edit acknowledgements and independent readbacks. A missing wire property is unreported, not false. A server permission refusal is reported separately from an accepted write. diff --git a/docs/mobile-port-progress.md b/docs/mobile-port-progress.md index 190f3a7..187c656 100644 --- a/docs/mobile-port-progress.md +++ b/docs/mobile-port-progress.md @@ -4,6 +4,8 @@ ## Возврат к разработке на ПК, 2026-11-26 +Windows, база `d5ba657`: в списках прав ядро учитывает каждый явно указанный ID и не смешивает строки разных групп при смене ID внутри пакета. Три адресных теста прошли, включая продолжение списка в следующем пакете. Это проверка разбора протокола, не живое изменение прав. + Windows, база `e9f375c`: проверен `command:rename` на двух временных identity и локальном beta14. Форма сохранила занятый ник после отказа и закрылась после успешной повторной отправки. Оба списка участников показали новое имя с прежним серверным UID, а после открытия профиля изменился только ник нужной локальной identity. Тест `nickname_refusal_keeps_draft_and_retry_updates_only_own_identity` прошёл; стенд остановлен. Windows, база `f804bef`: сворачивание скрывает непосредственных участников, сохраняется в `collapsedChannels` по адресу сервера и не скрывает подканалы. Три адресных теста прошли: Slint с двумя перезапусками и повтором номера канала на другом адресе, атомарность сохранения и регрессия порядка и размеров дерева. Проверены EN/dark и RU/light на снимках тестовых серверов.