All Docs
FeaturesDepositClearUpdated March 15, 2026

Auto-Escalation for Stuck Tenancies

Auto-Escalation for Stuck Tenancies

Available from: v0.1.362

What Is This?

In previous versions, a tenancy that had passed its end date would surface in the admin work queue (activePastEndDate bucket) but would not automatically transition to ended. If the nightly cron (tenancy-auto-end.ts) missed multiple consecutive runs, the tenancy would remain stuck in active indefinitely — requiring a human admin to manually trigger the forceEndTenancy mutation.

From v0.1.362, a dedicated watchdog function eliminates this stuck state automatically.


How It Works

A new Inngest function — active-past-enddate-watchdog — runs on a 6-hour cron schedule. On each run it:

  1. Queries for all tenancies where status = active and endDate < NOW() - 48h

  2. Transitions each matched tenancy from activeended

  3. Writes a structured audit event recording the automatic transition

  4. Sends an in-app notification to the responsible agent:

    "Tenancy at [address] automatically ended — end date was 2 days ago."

Timing

ConditionOutcome
endDate passed < 48 h agoNo action — within normal cron window
endDate passed ≥ 48 h ago, status activeWatchdog auto-transitions to ended
Status already ended or disputedNo action

Relationship to Existing Auto-End Logic

The watchdog is a safety net, not a replacement:

  • tenancy-auto-end.ts (nightly cron): The primary mechanism. Handles tenancies at or just past their end date on each nightly run.
  • active-past-enddate-watchdog (6-hour cron): Catches cases where the nightly cron missed one or more runs, or where a tenancy slipped through. Activates only after the 48-hour grace window.

Both mechanisms produce identical outcomes: activeended transition with a full audit trail.


Manual Override

The manual Force End Tenancy action (available to admins and owners via the dashboard) remains fully functional. Use it for:

  • Tenancies you want to close before the 48-hour watchdog window triggers
  • Edge cases requiring immediate resolution outside the automated schedule

The activePastEndDate work queue bucket continues to surface all overdue tenancies for admin visibility, regardless of whether the watchdog has acted.


Audit Trail

Every auto-transition performed by the watchdog is recorded as an audit event. The event includes:

  • The tenancy ID and address
  • The original endDate
  • The timestamp of the automated transition
  • The source (active-past-enddate-watchdog)

Audit events are visible in the standard audit log for the tenancy.


Agent Notifications

When the watchdog closes a tenancy, the assigned agent receives a notification:

Tenancy at [address] automatically ended — end date was 2 days ago.

This ensures agents are always informed when a case moves forward without their direct action, so they can proceed with deposit check-out workflows immediately.