Skip to content

feat: add per-client rate limiting for presence events#1705

Merged
edgurgel merged 3 commits intomainfrom
feat/client-presence-max-calls
Feb 9, 2026
Merged

feat: add per-client rate limiting for presence events#1705
edgurgel merged 3 commits intomainfrom
feat/client-presence-max-calls

Conversation

@edgurgel
Copy link
Member

@edgurgel edgurgel commented Feb 8, 2026

What kind of change does this PR introduce?

Adds rate limiting at the individual WebSocket connection level to prevent a single client from exhausting the tenant's presence quota. Each client is limited to a configurable number of presence calls within a time window (defaults to 5 calls per 30 seconds).

new CLIENT_PRESENCE_MAX_CALLS and CLIENT_PRESENCE_WINDOW_MS options

This feature prevents individual misbehaving or malicious clients from consuming the entire tenant's presence rate limit quota, improving fairness and abuse prevention.

The ideal place to do this is at the socket level but we don't have (yet) control on the phoenix.socket.

Adds rate limiting at the individual WebSocket connection level to prevent
a single client from exhausting the tenant's presence quota. Each client
is limited to a configurable number of presence calls within a time window
(defaults to 10 calls per 60 seconds).

new CLIENT_PRESENCE_MAX_CALLS and CLIENT_PRESENCE_WINDOW_MS options

This feature prevents individual misbehaving or malicious clients from consuming
the entire tenant's presence rate limit quota, improving
  fairness and abuse prevention.
@edgurgel edgurgel force-pushed the feat/client-presence-max-calls branch from 06efdd2 to f8d9e61 Compare February 8, 2026 23:48
@blacksmith-sh

This comment has been minimized.

@blacksmith-sh

This comment has been minimized.

@edgurgel
Copy link
Member Author

edgurgel commented Feb 9, 2026

** (ExCoveralls.ReportUploadError) Failed to upload the report to 'https://coveralls.io/' (reason: status_code = 422, body = {"message":"Can't add a job to a build that is already closed. Build 7c0b975-PR-1705 is closed. See docs.coveralls.io/parallel-builds","error":true}).

@edgurgel edgurgel merged commit 3a0d56e into main Feb 9, 2026
5 of 8 checks passed
@edgurgel edgurgel deleted the feat/client-presence-max-calls branch February 9, 2026 00:49
@kiwicopple
Copy link
Member

🎉 This PR is included in version 2.76.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments