← Back to Pull requests

fix(voxbento): sync soft-deleted rooms after commit #148

Open
unknown opened this pull request with 452 lines diff across 5 files
View on GitHub
unknown unknown commented on Oct 27, 2026 13:34 UTC
Author

What

Remove the corresponding VoxBento room when an organizer soft-deletes a room in Eventyay.

Why

Fixes #147.

Eventyay saves deleted=True rather than deleting the room row, so the existing pre-save handler sends an upsert and the post-delete handler never runs.
The browser reproduction confirmed that the room and booth remained in VoxBento after Eventyay reported successful deletion.

How

  • Skip the pre-save upsert for a deleted room and schedule the existing delete task after its save commits.

  • Capture room and event IDs for the commit callback.

  • Skip deleted-room upserts in _do_sync_single_room_to_voxbento, preventing queued updates executed after deletion from recreating the room.
  • Keep the existing hard-delete, retry, and active-booth protection behavior.
    No Eventyay core changes or migrations are needed.

    Before

    https://github.com/user-attachments/assets/521a7794-74f5-498d-83ff-49909a2055fe

    After

    https://github.com/user-attachments/assets/57621090-7432-4c7a-92a9-d0311dd62b72

    Testing

    Added ten lifecycle cases in tests/test_room_sync.py; five regressions fail on unfixed dev, while five existing-behavior controls pass.
    All ten pass with the fix, covering soft deletion, rollback, deleted-room upserts, creation, updates, hard deletion, retry, and active-booth refusal.

  • pytest tests/ -v: 88 passed, with five host-environment warnings for an optional missing secrets directory and Django mail deprecations.

  • ruff check .: passed.

  • ruff format --check .: passed.

  • git diff --check: passed.
  • Replayed the same real-browser deletion flow against both applications: before sent PUT 200 and left the remote room and booth; after sent DELETE 204 and left no remote rooms or booths.
    OAuth setup was preseeded, API responses were not mocked in the browser run, and media was not exercised.

    Summary by Sourcery

    Ensure soft-deleted Eventyay rooms are reliably removed from VoxBento without allowing stale synchronization tasks to recreate them.

    Bug Fixes:

  • Synchronize soft-deleted rooms with VoxBento after the database commit, removing remote rooms and clearing their stored mappings.

  • Prevent stale or in-flight room upserts from recreating rooms after deletion, while reconciling concurrent restores and preserving existing deletion safeguards.

  • Retry deletions when VoxBento configuration or access credentials are unavailable instead of silently skipping them.
  • Enhancements:

  • Extend bulk room synchronization to reconcile both active and soft-deleted rooms.

  • Strengthen room lifecycle handling for rollback, concurrent changes, retries, hard deletion, and active-booth protection.
  • Tests:

  • Add comprehensive room synchronization lifecycle coverage for soft deletion, restoration, concurrency, retries, configuration failures, and existing behavior.
  • <!-- This is an auto-generated comment: release notes by coderabbit.ai -->
    <!-- coderabbit-ai-generated:v1 -->

    Summary by CodeRabbit

    Bug Fixes
    Deleted rooms are removed from VoxBento after changes are committed and are not added or updated by delayed synchronization tasks.
    New rooms and applicable changes continue to sync. Temporary connection failures or missing connection details can be retried, and stale deletion requests do not remove active rooms.
    After deletion is confirmed, saved VoxBento session details are cleared and interpretation status is reset. Restored rooms are added again, and deletions that occurred while synchronization was unavailable are reconciled when it resumes.
    <!-- end of auto-generated comment: release notes by coderabbit.ai -->

    Diff: 452 lines (+339 / -113) across 5 files Reviewer: Nirupon123 Review duration: 50035m
    All Vouch review confidence checks passed
    Residual risk 0.29 = Change Risk (0.52) × (1 − Review Confidence (0.45)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.52 · 452 lines diff across 5 files
    0.52
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    44%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.366
    Shallow Review Depth shallow_review_depth
    0.344
    Real PR Conversation Timeline
    1 comments
    "Review active on #148"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 44.7% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 52.4% (MEDIUM) · Higher = larger blast radius
    52.4%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 44.7% · Lower = rushed or shallow review
    44.7%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 29.0% · Safe to merge
    29.0%