From 5b275784f1218e68eaf8dd9127ff97ccef891a32 Mon Sep 17 00:00:00 2001 From: Hamish Farrant Date: Wed, 13 May 2026 15:20:57 +1000 Subject: [PATCH] [PE-1481] Always return 3 elements from request for pagination support The request method conditionally appended next_page only when paginate was true, returning a 2- or 3-element array. Subclasses that destructure with `response, status = super(...)` silently dropped the third element, breaking pagination. Always return [data, status, next_page] so subclass overrides propagate the cursor correctly. Co-Authored-By: Claude Opus 4.6 --- lib/oktakit/client.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/oktakit/client.rb b/lib/oktakit/client.rb index 5ed2311..b5c2c75 100644 --- a/lib/oktakit/client.rb +++ b/lib/oktakit/client.rb @@ -185,9 +185,7 @@ def request(method, path, data:, query:, headers:, accept:, content_type:, pagin uri = URI::DEFAULT_PARSER.escape("/api/v1" + path.to_s) @last_response = resp = sawyer_agent.call(method, uri, data, options) - response = [resp.data, resp.status] - response << absolute_to_relative_url(resp.rels[:next]) if paginate - response + [resp.data, resp.status, paginate ? absolute_to_relative_url(resp.rels[:next]) : nil] end def sawyer_agent