Skip to content

fix(call): return proper permission errors when starting a call is not allowed - #18664

Merged
nickvergessen merged 3 commits into
nextcloud:mainfrom
pascalkienast:bugfix/noid/start-call-permission-error-handling
Jul 15, 2026
Merged

nickvergessen merged 3 commits into
nextcloud:mainfrom
pascalkienast:bugfix/noid/start-call-permission-error-handling

Conversation

@pascalkienast

@pascalkienast pascalkienast commented Jul 14, 2026 •

Copy link
Copy Markdown
Contributor

☑️ Resolves

Both issues can occur when the host restricts who may start calls, for example when start_calls is set to “Moderators only”:

  • Federation: The participant’s server determines the call button state using its own start_calls setting. It does not know the host’s setting. If the host is more restrictive, the federated participant still sees an active “Start call” button. The host then returns the correct 403, but the proxying server wraps it in a CannotReachRemoteException. The user sees what looks like a connection error instead of a permission error.
  • Signaling/HPB: If the backend join path tries to mark the first participant as in-call when that participant is not allowed to start the call, Talk throws a ForbiddenException. The exception currently escapes instead of being returned as a structured backend error. SIP dial-in is one way to reach this path.

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

🛠️ API Checklist

🚧 Tasks

How to test

Federation fix:

  1. On the host: set "Start calls" to "Moderators only" (Talk admin settings)
  2. Invite a federated user (non-moderator) to a conversation, no active call
  3. Federated user clicks "Start call"
  • Before: generic connection/reach error (CannotReachRemoteException)
  • After: proper 403 / permission feedback

Signaling fix:

  1. Same restriction; trigger a call start via the signaling backend for a
    participant who may not start (e.g. SIP dial-in into a not-yet-started call)
  • Before: uncaught ForbiddenException, unstructured error at the HPB
  • After: structured start_call_not_allowed backend error

🏁 Checklist

  • ⛑️ Tests (unit and/or integration) are included or not possible
  • 📘 API documentation in docs/ has been updated or is not required
  • 🔖 Capability not needed

Should be backportable to all supported stable branches; #18647 will be rebased on top once this is merged

…ng a call

The proxying server only accepted 200/400/404 from the host when joining
a federated call. A 403 - returned by the host e.g. when start_calls
restricts who may start calls and the federated participant is not
allowed - was wrapped into a CannotReachRemoteException, so users saw
what looked like a connection error instead of a permission error.

Accept 403 as an expected status code, document it on the endpoint and
regenerate the OpenAPI spec and types.

Assisted-by: ClaudeCode:claude-fable-5
Signed-off-by: Pascal Kienast <info@pascalkienast.de>
… allowed

When the signaling backend join path marks the first participant as
in-call and that participant is not allowed to start the call, the
ForbiddenException thrown by the RestrictStartingCalls listener escaped
uncaught, so the HPB received an unstructured error instead of a proper
backend error. SIP dial-in into a not-yet-started call is one way to
reach this path.

Catch the exception and return a structured 'start_call_not_allowed'
backend error instead.

Assisted-by: ClaudeCode:claude-fable-5
Signed-off-by: Pascal Kienast <info@pascalkienast.de>
…ll" settings

Signed-off-by: Joas Schilling <coding@schilljs.com>
@nickvergessen nickvergessen self-assigned this Jul 14, 2026
@nickvergessen
nickvergessen self-requested a review July 14, 2026 15:18
@nickvergessen nickvergessen removed their assignment Jul 14, 2026
@nickvergessen nickvergessen added bug feature: api 🛠️ OCS API for conversations, chats and participants labels Jul 14, 2026
@nickvergessen nickvergessen added this to the ⛅ Next Major (35) milestone Jul 14, 2026
@nickvergessen

Copy link
Copy Markdown
Member

/backport to stable34

@nickvergessen

Copy link
Copy Markdown
Member

/backport to stable33

@nickvergessen

Copy link
Copy Markdown
Member

/backport to stable32

@nickvergessen nickvergessen added the AI assisted This PR contains AI-assisted commits label Jul 14, 2026
@nickvergessen

Copy link
Copy Markdown
Member

Failure in tests/integration/features/federation/call.feature#L81 is expected until stable34 was patched

Failure in tests/integration/features/chat-4/scheduled-messages.feature#L581 was fixed with #18668

@github-actions

Copy link
Copy Markdown
Contributor

Hello there,
Thank you so much for taking the time and effort to create a pull request to our Nextcloud project.

We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process.

Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6

Thank you for contributing to Nextcloud and we hope to hear from you soon!

(If you believe you should not receive this message, you can add yourself to the blocklist.)

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

Labels

AI assisted This PR contains AI-assisted commits bug feature: api 🛠️ OCS API for conversations, chats and participants feature: call 📹 Voice and video calls feature: federation 🌐 feedback-requested

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants