Skip to content

Files sharing should show a clearer message when share creation is rate limited #60729

Description

@hweihwang

Steps to reproduce

  1. Sign in as a normal user.
  2. Open the sharing dialog for a file or folder.
  3. Create public link shares repeatedly until the ShareAPIController::createShare user rate limit is reached.
  4. Try to create another share, either on the same item or another item.

Expected behavior

The UI should explain that share creation is temporarily rate limited, for example:

Share creation is temporarily rate limited. Please wait a few minutes before creating more shares.

Ideally it should also make clear that this is a per-user/time-window creation limit, not a per-file or per-folder share limit.

Actual behavior

The request returns HTTP 429 / Too Many Requests, but the Files sharing UI does not give enough context for admins or users to understand why share creation stopped. This can be mistaken for a per-file share limit or a broken sharing dialog.

Technical context

OCA\Files_Sharing\Controller\ShareAPIController::createShare is intentionally protected with:

#[UserRateLimit(limit: 20, period: 600)]

When the limit is exceeded, RateLimitingMiddleware returns a generic 429 response. The frontend currently falls back to the response metadata, if available, or a generic share creation error.

Suggested improvement

Handle 429 responses from the share creation request in the Files sharing frontend and show a dedicated translated message. This should avoid implying that the file/folder has reached a permanent sharing limit.

Notes

This issue is only about improving the user-facing error message. It does not request changing the existing rate limit.

Activity

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

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions