Preserve 429/503 retry status codes through DoActionRequest (#36700)

* Preserve 429/503 retry status codes through DoActionRequest

DoActionRequest collapsed all plugin non-200 responses to 400, losing
the retry semantics carried by 429 and 503 (RFC 6585, RFC 7231). This
preserves 429/503 verbatim, maps other 5xx to 502 Bad Gateway, and
leaves other non-200 responses wrapped as 400.

* update api documentation for new errors

* fix tests affected by change

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
Co-authored-by: Scott Bishel <scott.bishel@mattermost.com>
This commit is contained in:
Adam Schildkraut
2026-07-10 12:19:25 -06:00
committed by GitHub
co-authored by Mattermost Build Scott Bishel
parent 14288c742b
commit af49e8dc80
5 changed files with 151 additions and 5 deletions
+22
View File
@@ -1000,6 +1000,28 @@
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
"429":
description: The upstream integration rate-limited the request. The
original status code is preserved so clients can honor retry
semantics.
content:
application/json:
schema:
$ref: "#/components/schemas/AppError"
"502":
description: The upstream integration returned a 5xx (other than 503).
Surfaced as Bad Gateway because the failure is upstream of Mattermost.
content:
application/json:
schema:
$ref: "#/components/schemas/AppError"
"503":
description: The upstream integration is unavailable. The original
status code is preserved so clients can honor retry semantics.
content:
application/json:
schema:
$ref: "#/components/schemas/AppError"
"/api/v4/posts/ids":
post:
tags: