From 2fcaf469c68d413303f7ba34ab6ca124870e5ceb Mon Sep 17 00:00:00 2001 From: oppiliappan Date: Sun, 1 Jun 2025 19:30:14 +0100 Subject: [PATCH] appview: pulls: supply posthog client to PullsRouter Change-Id: zrkqwwrtxvznyvkztummsqzkoktowrpk if the client is nil, posthog fails to enqueue a request, it crashes the route and prevents redirect (as seen while creating pull comments and pull requests) Signed-off-by: oppiliappan --- appview/pulls/pulls.go | 2 ++ appview/state/router.go | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/appview/pulls/pulls.go b/appview/pulls/pulls.go index 6cbd3c6..ee3e069 100644 --- a/appview/pulls/pulls.go +++ b/appview/pulls/pulls.go @@ -51,6 +51,7 @@ func New( resolver *idresolver.Resolver, db *db.DB, config *config.Config, + posthog posthog.Client, ) *Pulls { return &Pulls{ oauth: oauth, @@ -59,6 +60,7 @@ func New( idResolver: resolver, db: db, config: config, + posthog: posthog, } } diff --git a/appview/state/router.go b/appview/state/router.go index 5c59be2..926cede 100644 --- a/appview/state/router.go +++ b/appview/state/router.go @@ -178,7 +178,7 @@ func (s *State) IssuesRouter(mw *middleware.Middleware) http.Handler { } func (s *State) PullsRouter(mw *middleware.Middleware) http.Handler { - pulls := pulls.New(s.oauth, s.repoResolver, s.pages, s.idResolver, s.db, s.config) + pulls := pulls.New(s.oauth, s.repoResolver, s.pages, s.idResolver, s.db, s.config, s.posthog) return pulls.Router(mw) } -- 2.43.0