From f5f430befd2f9de541fb4d7fd3a9905e1956553c Mon Sep 17 00:00:00 2001 From: "oppi.li" Date: Thu, 1 May 2025 09:50:58 +0000 Subject: [PATCH] appview: profile: fix panic in timeline generation off by one --- appview/db/profile.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/appview/db/profile.go b/appview/db/profile.go index 49e9cf0..3e9bd5a 100644 --- a/appview/db/profile.go +++ b/appview/db/profile.go @@ -81,7 +81,7 @@ type PullEventStats struct { Merged int } -const TimeframeMonths = 3 +const TimeframeMonths = 7 func MakeProfileTimeline(e Execer, forDid string) (*ProfileTimeline, error) { timeline := ProfileTimeline{ @@ -99,7 +99,7 @@ func MakeProfileTimeline(e Execer, forDid string) (*ProfileTimeline, error) { for _, pull := range pulls { pullMonth := pull.Created.Month() - if currentMonth-pullMonth > TimeframeMonths { + if currentMonth-pullMonth >= TimeframeMonths { // shouldn't happen; but times are weird continue } @@ -118,7 +118,7 @@ func MakeProfileTimeline(e Execer, forDid string) (*ProfileTimeline, error) { for _, issue := range issues { issueMonth := issue.Created.Month() - if currentMonth-issueMonth > TimeframeMonths { + if currentMonth-issueMonth >= TimeframeMonths { // shouldn't happen; but times are weird continue } @@ -146,7 +146,7 @@ func MakeProfileTimeline(e Execer, forDid string) (*ProfileTimeline, error) { repoMonth := repo.Created.Month() - if currentMonth-repoMonth > TimeframeMonths { + if currentMonth-repoMonth >= TimeframeMonths { // shouldn't happen; but times are weird continue } -- 2.51.2