Skip to content

Reassigning a booking can leave the new host double-bookable (booking_hosts updated outside the transaction) #186

Closed

Description

@MohammadHadi2031

Before submitting

  • I've searched existing issues and this isn't a duplicate.
  • This is a reproducible bug in Calnode — not a configuration/setup question or a feature request.

What's the bug?

Service.ReassignHost commits bookings.host_id on its own. ReassignBooking then updates booking_hosts in a separate statement whose failure is only logged (internal/handler/reassign.go). hostBusy reads booking_hosts, so in that window, or permanently if the update fails, the new host looks free at that time (bookable twice) while the old host stays blocked.

Reassigning onto someone who is already a co-host of that booking (a collective's secondary seat) always fails that update, because it violates UNIQUE(booking_id, user_id). The booking is left with host_id and its seats disagreeing, and the API still returns 200.

The old host's calendar event is also cancelled with an empty calendar id, so it falls back to their current destination rather than the calendar it was recorded in.

Steps to reproduce

NA

Calnode version / commit

v0.11.2

How are you running Calnode?

Self-hosted — Docker

Logs, screenshots, or anything else

No response

Activity

  1. pullfrog commented on Oct 28, 2026

    @pullfrog
    Contributor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions