mirror of
https://github.com/penpot/penpot.git
synced 2026-10-29 22:10:34 +00:00
The announcement path is the primary mechanism, but it cannot see an access change that fires no command here: Nitrate transferring the ownership of an organization is an HTTP call to another service, and rows deleted straight over SQL publish nothing. Both keep a subscription alive until the connection happens to close. Each relay now re-checks access every `subscription-revalidation-interval` (5 minutes by default, overridable) and drops the subscription when it no longer holds. The default is a code constant in `app.http.websocket` rather than the `config.clj` default map, matching how session lifetimes are configured. The re-check is a scheduled task rather than a timer inside the relay loop, on purpose: driven by the loop, a steady stream of edits would push the check away forever and a busy file would never be re-checked at all. `start-relay` also replaces the `sp/pipe` of the team subscription and the ad-hoc `go-loop` of the file one, so both now share the same forwarding and re-check path. `still-authorized?` is the one place that fails open: a transient database error logs and keeps the subscription rather than kicking a user out of an editor, and the next tick tries again. Closes #12155 AI-assisted-by: space-bunny-free