mirror of
https://github.com/block/buzz.git
synced 2026-10-29 13:31:44 +00:00
Three correctness fixes from Thufir pass-1 review at 08467d582:
P2 (retain error at wrong boundary): remove ? from retain_result inside
the blocking phase's Ok(...) return, completing linked managed-agent
name/avatar propagation (save_managed_agents) and relay kind:0 profile
sync (phase 2) before propagating the error. Add regression test in
sharing.rs using update_persona_with with a prepare_persona_publication_at
closure (EISDIR failure) and counter server; mutation restoring retain_result?
before phase 2 makes count == 0 → RED. Complementary counter-server test
in concurrent_edit_tests.rs with injected Err closure also turns RED.
P1-2 (lock-scope regression has no actual race): replace the stub try_lock
test with a real concurrency regression using std::sync::Barrier(2). The
barrier fires inside the REFRESH_LOCK_OBSERVER while the lock is held,
releasing a racing OS thread that blocks on managed_agents_store_lock.lock()
until refresh completes, then retains an unshared persona head at T+1.
Final assertion verifies the retained event is both later than the seed AND
unshared. Mutation (remove/move lock acquisition) causes try_lock() to
succeed → first assert panics → RED.
D+L retry-failure (family-12 gap): add
test_combined_dl_save_publish_retry_failure_names_both_catalog_and_remainder
symmetric to the D+I case: publish throws, retry also fails, policy write
must be skipped (firstError blocks step 3), warning names profile as saved
+ auto-restart policy as unsaved remainder + catalog publication as failure.
Co-authored-by: Will Pfleger <pfleger.will@gmail.com>
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>