authorclover caruso <git@paperclover.net> 2026-10-10 21:34:25-07:00
committerclover caruso <git@paperclover.net> 2026-10-10 22:56:06-07:00
log6578d5a16cd452ade71e26f61943fe015f24df38
tree159618199cab1d8d65c300dc2072d5d86e68864b
parent96172e13a7a316a5fc038b61aa836d3f91d8a837
signature Signed by SSH key SHA256:52mNGHRsVFBDED9IAX5pe+LRWUefqTbxEReunq21QvU (~clover)

test: keep history restoration coverage focused on chronology

Remove a standalone mutex that did not reach State.perform. This unit regression proves exact Undo/Redo stack restoration before newer edits on another page; real preflight contention remains an application runtime check. Assisted-by: gpt-6.1-sol

1 files changed, 1 insertions(+), 6 deletions(-)

crates/snowbound/src/undo.rs+1-6
...@@ -1338,7 +1338,7 @@ mod tests {...@@ -1338,7 +1338,7 @@ mod tests {
1338 }1338 }
13391339
1340 #[test]1340 #[test]
1341 fn contended_page_actions_keep_their_position_in_undo_and_redo() {1341 fn refused_page_actions_keep_their_position_in_undo_and_redo() {
1342 for redo in [false, true] {1342 for redo in [false, true] {
1343 let mut timeline = Timeline::default();1343 let mut timeline = Timeline::default();
1344 let action = Action {1344 let action = Action {
...@@ -1360,9 +1360,6 @@ mod tests {...@@ -1360,9 +1360,6 @@ mod tests {
1360 else {1360 else {
1361 panic!("the current page has a pending action");1361 panic!("the current page has a pending action");
1362 };1362 };
1363 let structure = Arc::new(async_lock::Mutex::new(()));
1364 let changing = structure.try_lock_arc().unwrap();
1365 assert!(structure.try_lock_arc().is_none());
1366 timeline.put_back((redo, at), action);1363 timeline.put_back((redo, at), action);
1367 let depth = if redo { [0, 1] } else { [1, 0] };1364 let depth = if redo { [0, 1] } else { [1, 0] };
1368 assert!(1365 assert!(
...@@ -1370,8 +1367,6 @@ mod tests {...@@ -1370,8 +1367,6 @@ mod tests {
1370 "newer edit stays first"1367 "newer edit stays first"
1371 );1368 );
1372 timeline.stepped(page(3), redo);1369 timeline.stepped(page(3), redo);
1373 drop(changing);
1374 let _changing = structure.try_lock_arc().unwrap();
1375 let Some(Next::Action(action, at)) = timeline.next(redo, page(1), [0, 0], &here())1370 let Some(Next::Action(action, at)) = timeline.next(redo, page(1), [0, 0], &here())
1376 else {1371 else {
1377 panic!("the refused action must remain in its original stack");1372 panic!("the refused action must remain in its original stack");