Attempting to upload more than 5 files via the API results in a confusing error message

Description

Report: https://github.com/mattermost/mattermost-server/issues/10023

When creating post (HTTP POST request to '/posts' URI) API responses with error model.post.is_valid.file_ids.app_error (Invalid file ids) when number of file IDs provided in request is more than five.

Repro:
1. Auth in mattermost API to be able to interact with it.
2. Upload 6 or more test files to any channel (including direct channels) or get IDs of already uploaded 6 or more files, using the API call above.
3. Try to create a post with 6 or more files attached.

Observed: API responses with an not-obvious error 'Invalid file IDs' (model.post.is_valid.file_ids.app_error).
The server source code analysis shows this may be an unintentional behavoiur of server.

Expected:

  • Error message "Uploads limited to 5 files maximum. Please use additional posts for more files."

  • Update to our API documentation that explicitly states the limitation on amount of files attached to a single post.

QA Test Steps

No testing required.

Reporter

None

Status

Mana

None

Assignee

Jason Blais

QA Assignee

None

Reporter

Jason Blais

Epic Link

None

Fix versions

Mattermost Team

ABC

Sprint

None

Labels

None

QA Testing Areas

None

GitHub Issue

None

Components

None
Configure