You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by ka...@apache.org on 2023/05/17 21:07:50 UTC

[incubator-devlake] branch main updated: fix: Correct paging behaviour during PagerDuty service enumeration (#5213)

This is an automated email from the ASF dual-hosted git repository.

ka94 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git


The following commit(s) were added to refs/heads/main by this push:
     new 6ad138228 fix: Correct paging behaviour during PagerDuty service enumeration (#5213)
6ad138228 is described below

commit 6ad138228ad6d0ae402368fb304aa718bce1b53d
Author: Alexis Vanier <av...@users.noreply.github.com>
AuthorDate: Wed May 17 17:07:44 2023 -0400

    fix: Correct paging behaviour during PagerDuty service enumeration (#5213)
    
    This commit/PR fixes issue 5212 where when paging across PagerDuty
    services the offset is incremented by the number of pages, resulting
    in only one more new service being displayed along with 99 more other
    services that were already displayed.
---
 backend/plugins/pagerduty/api/remote.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/backend/plugins/pagerduty/api/remote.go b/backend/plugins/pagerduty/api/remote.go
index 4f2ef6edd..6cb4ab064 100644
--- a/backend/plugins/pagerduty/api/remote.go
+++ b/backend/plugins/pagerduty/api/remote.go
@@ -302,7 +302,7 @@ func DecodeFromPageToken(pageToken string) (*PageData, errors.Error) {
 
 func GetQueryFromPageData(pageData *PageData) (url.Values, errors.Error) {
 	query := url.Values{}
-	query.Set("offset", fmt.Sprintf("%v", pageData.Page))
+	query.Set("offset", fmt.Sprintf("%v", pageData.Page*pageData.PerPage))
 	query.Set("limit", fmt.Sprintf("%v", pageData.PerPage))
 	return query, nil
 }