Skip to content

Fix DS stale state after DO reset by broadcasting delete events#139

Merged
koenvanderveen merged 2 commits intomainfrom
koen/fix-ds-stale-state-after-do-reset
Feb 18, 2026
Merged

Fix DS stale state after DO reset by broadcasting delete events#139
koenvanderveen merged 2 commits intomainfrom
koen/fix-ds-stale-state-after-do-reset

Conversation

@koenvanderveen
Copy link
Collaborator

Summary

  • When a DO calls delete_syftbox(), broadcast is_deleted=True events for all tracked files to each approved peer's outbox before cleanup
  • Add _cleanup_stale_dataset_collections to DS watcher cache to remove locally cached datasets that no longer exist remotely
  • Add delete_directory() to both in-memory and filesystem cache connections
  • Fix delete_multiple_files_by_ids to work with mock drive services (fallback to individual deletes)
  • Add broadcast_delete_events=False param for test cleanup calls

Test plan

  • New unit test test_ds_stale_state_cleared_after_do_delete_syftbox passes
  • All 184 unit tests pass (uv run pytest tests/unit/ -n auto)
  • Repro script shows Bug 1: NOT REPRODUCED (uv run python scripts/repro_reset_bugs.py)

🤖 Generated with Claude Code

koenvanderveen added a commit that referenced this pull request Feb 18, 2026
When a DO deletes their SyftBox, the DS still showed stale state (datasets,
file_hashes) from the previous session. Fix by broadcasting is_deleted=True
events for all tracked files to each approved peer's outbox before cleanup.
Also clean up stale dataset collections on DS when they no longer exist remotely.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@koenvanderveen koenvanderveen force-pushed the koen/fix-ds-stale-state-after-do-reset branch from 1c38752 to 3034fb2 Compare February 18, 2026 13:00
When a DO deletes their SyftBox, the DS still showed stale state (datasets,
file_hashes) from the previous session. Fix by broadcasting is_deleted=True
events for all tracked files to each approved peer's outbox before cleanup.
Also clean up stale dataset collections on DS when they no longer exist remotely.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@koenvanderveen koenvanderveen force-pushed the koen/fix-ds-stale-state-after-do-reset branch from 3034fb2 to afafadc Compare February 18, 2026 13:06
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@koenvanderveen koenvanderveen merged commit 062ba9f into main Feb 18, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments