From fc62f2a327dfce84e45309ecf3239998251a4085 Mon Sep 17 00:00:00 2001 From: paula-alves Date: Fri, 6 Nov 2026 23:05:38 +0000 Subject: [PATCH] fix(sports): stop a not-yet-published Liga squad re-read from the error hub MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Liga 400s team/squad until it publishes a team's season list (newly promoted or still pre-season), same shape already fixed for importLigaSquads and backfillLigaRegister in BIT-31672 (c864a48). The on-the-spot re-read in syncEventSquadsNow (added later, f5fb4bb) still logged every failure at warn, and the pino->error-hub hook forwards any warn carrying an `err` — so a routine early read of the event's squads reached the hub (ERRCLUSTER 5b8e55fcfd43). Distinguish a 400 (not published yet, read again next refresh) from a real failure here too: info instead of warn for the former. Paperclip-Agent: José Alves (urlKey jos-alves; id 11179220-3cec-4f0f-880d-2771ff64fce8) Paperclip-Issue: BIT-32086 Paperclip-Run: 85fc6c83-a04d-40ad-a5ea-55e9719e33e7 --- apps/api/src/sports/service.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/api/src/sports/service.ts b/apps/api/src/sports/service.ts index 3248265..06d2898 100644 --- a/apps/api/src/sports/service.ts +++ b/apps/api/src/sports/service.ts @@ -1458,7 +1458,10 @@ export class SportsService { try { await this.savePlayers(team.id, season, await this.liga.squad(team.externalId, season), "api"); } catch (err) { - log.warn({ err, team: team.id }, "sports: liga squad re-read failed"); + // Same not-yet-published 400 as importLigaSquads/backfillLigaRegister: expected, kept out of the error hub. + if (err instanceof ProviderHttpError && err.status === 400) + log.info({ err, team: team.id }, "sports: liga squad not published yet for this team"); + else log.warn({ err, team: team.id }, "sports: liga squad re-read failed"); } } for (const team of [event.homeTeam, event.awayTeam]) {