Skip to content

Free, Open Source, Self-Hosted WhatsApp API Gateway

docs(group): move the 5xx note from the settings 503 to the picture 503

Yudhi Armyndharis96e84c8dcb0e
diff --git a/src/modules/group/group.controller.spec.ts b/src/modules/group/group.controller.spec.ts
index 1aec6c2f1..2126a33d0 100644
--- a/src/modules/group/group.controller.spec.ts
+++ b/src/modules/group/group.controller.spec.ts
@@ -168,6 +168,13 @@ describe('GroupController OpenAPI responses', () => {
expect(silent).toEqual([]);
});
+ // On Baileys the picture lookup also maps a WhatsApp 5xx to 503; the metadata query behind the
+ // settings read does not, so a 5xx there answers 500 and its 503 must not promise otherwise.
+ it('names the WhatsApp 5xx on the picture 503 and not on the settings 503', () => {
+ expect(responsesOf('getPicture')['503']?.description).toContain('5xx');
+ expect(responsesOf('getSettings')['503']?.description).not.toContain('5xx');
+ });
+
it('declares the rate-limited 503 on group creation', () => {
expect(responsesOf('create')['503']?.description).toContain('429');
});
diff --git a/src/modules/group/group.controller.ts b/src/modules/group/group.controller.ts
index 9cd63e794..fa89c1e08 100644
--- a/src/modules/group/group.controller.ts
+++ b/src/modules/group/group.controller.ts
@@ -156,10 +156,7 @@ export class GroupController {
@ApiResponse({ status: 404, description: 'Group not found' })
@ApiResponse({
status: 503,
- description:
- 'WhatsApp did not answer within the request budget — nothing could be read.' +
- THROTTLED_503 +
- ' On Baileys, a WhatsApp server error (5xx) on the lookup also answers 503.',
+ description: 'WhatsApp did not answer within the request budget — nothing could be read.' + THROTTLED_503,
})
@ApiResponse({ status: 400, description: SESSION_NOT_STARTED_400 })
@ApiResponse({ status: 409, description: ENGINE_NOT_READY_409 })
@@ -511,7 +508,10 @@ export class GroupController {
@ApiResponse({ status: 400, description: 'The id does not name a group, or the session is not active' })
@ApiResponse({
status: 503,
- description: 'WhatsApp did not answer within the request budget — nothing could be read.' + THROTTLED_503,
+ description:
+ 'WhatsApp did not answer within the request budget — nothing could be read.' +
+ THROTTLED_503 +
+ ' On Baileys, a WhatsApp server error (5xx) on the lookup also answers 503.',
})
@ApiResponse({ status: 409, description: ENGINE_NOT_READY_409 })
async getPicture(@Param('sessionId') sessionId: string, @Param('groupId') groupId: string) {