From 6f37eaea3fef177de48c175b32492f0d79c5ea58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20Ga=C4=87e=C5=A1a?= Date: Thu, 30 Jan 2025 16:09:55 +0000 Subject: [PATCH] fix: [CODE-3120]: reload repo in repo summary API controller (#3356) * reload repo in repo summary API controller --- app/api/controller/repo/summary.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/api/controller/repo/summary.go b/app/api/controller/repo/summary.go index 2dc7d1c68..d5105ac1b 100644 --- a/app/api/controller/repo/summary.go +++ b/app/api/controller/repo/summary.go @@ -35,6 +35,12 @@ func (c *Controller) Summary( return nil, fmt.Errorf("access check failed: %w", err) } + // fetch the repo because the one we have probably comes from the cache. + repo, err = c.repoStore.Find(ctx, repo.ID) + if err != nil { + return nil, fmt.Errorf("failed to get the repo: %w", err) + } + summary, err := c.git.Summary(ctx, git.SummaryParams{ReadParams: git.CreateReadParams(repo)}) if err != nil { return nil, fmt.Errorf("failed to get repo summary: %w", err)