forked from tangled.org/core
Monorepo for Tangled — https://tangled.org

appview: profile: fix panic in timeline generation

off by one

authored by oppi.li and committed by Tangled f5f430be 8d7373fa

Changed files
+4 -4
appview
+4 -4
appview/db/profile.go
··· 81 Merged int 82 } 83 84 - const TimeframeMonths = 3 85 86 func MakeProfileTimeline(e Execer, forDid string) (*ProfileTimeline, error) { 87 timeline := ProfileTimeline{ ··· 99 for _, pull := range pulls { 100 pullMonth := pull.Created.Month() 101 102 - if currentMonth-pullMonth > TimeframeMonths { 103 // shouldn't happen; but times are weird 104 continue 105 } ··· 118 for _, issue := range issues { 119 issueMonth := issue.Created.Month() 120 121 - if currentMonth-issueMonth > TimeframeMonths { 122 // shouldn't happen; but times are weird 123 continue 124 } ··· 146 147 repoMonth := repo.Created.Month() 148 149 - if currentMonth-repoMonth > TimeframeMonths { 150 // shouldn't happen; but times are weird 151 continue 152 }
··· 81 Merged int 82 } 83 84 + const TimeframeMonths = 7 85 86 func MakeProfileTimeline(e Execer, forDid string) (*ProfileTimeline, error) { 87 timeline := ProfileTimeline{ ··· 99 for _, pull := range pulls { 100 pullMonth := pull.Created.Month() 101 102 + if currentMonth-pullMonth >= TimeframeMonths { 103 // shouldn't happen; but times are weird 104 continue 105 } ··· 118 for _, issue := range issues { 119 issueMonth := issue.Created.Month() 120 121 + if currentMonth-issueMonth >= TimeframeMonths { 122 // shouldn't happen; but times are weird 123 continue 124 } ··· 146 147 repoMonth := repo.Created.Month() 148 149 + if currentMonth-repoMonth >= TimeframeMonths { 150 // shouldn't happen; but times are weird 151 continue 152 }