Skip to content

[Shopify] Fix wrong dictionary used for pagination cursor in ReturnsAPI#8309

Merged
onbuyuka merged 1 commit into
mainfrom
bugs/636657-returnsapi-cursor
May 27, 2026
Merged

[Shopify] Fix wrong dictionary used for pagination cursor in ReturnsAPI#8309
onbuyuka merged 1 commit into
mainfrom
bugs/636657-returnsapi-cursor

Conversation

@onbuyuka
Copy link
Copy Markdown
Contributor

@onbuyuka onbuyuka commented May 26, 2026

What this changes

In Shpfy Returns API (codeunit 30250), procedures GetReturnLocations (lines 107–130) and GetReturnLocationsFromReturnFulfillOrder (lines 132–155) both declare a local LineParameters: Dictionary of [text, Text] and pass that dictionary to CommunicationMgt.ExecuteGraphQL — but they were writing the After cursor into the module-level Parameters dictionary instead.

As a result the {{After}} placeholder in GetNextReverseFulfillmentOrders.graphql and GetNextReverseFulfillmentOrderLines.graphql (both substituted from LineParameters) was never populated, breaking pagination beyond the first 10 reverse-fulfillment-orders for a return, or the first 10 line items of a reverse fulfillment order.

The user-visible symptom is Shpfy Return Lines with missing Location IDs, and credit memos that consequently lose the restock-to-location information for the affected lines. The intermittence depends on whether a return reaches the >10 reverse-fulfillment-orders or >10 lines-per-RFO thresholds.

This PR replaces the three Parameters references in each procedure with LineParameters — the dictionary that is actually passed to ExecuteGraphQL. Six lines changed total.

Why no test

There is no existing unit-test coverage for GetReturnLocations / GetReturnLocationsFromReturnFulfillOrder in src/Apps/W1/Shopify/Test. A pagination test would need new mock-GraphQL fixtures that simulate the pageInfo.hasNextPage contract for the reverseFulfillmentOrders connection and a multi-page disposition response. That harness work is out of scope for this surgical fix; a follow-up to add coverage is welcome.

Fixes AB#636657

GetReturnLocations and GetReturnLocationsFromReturnFulfillOrder in
Shpfy Returns API (codeunit 30250) declare a local LineParameters
dictionary and pass it to CommunicationMgt.ExecuteGraphQL, but both
procedures wrote the After cursor to the module-level Parameters
dictionary instead. As a result the {{After}} placeholder in
GetNextReverseFulfillmentOrders.graphql and
GetNextReverseFulfillmentOrderLines.graphql was never substituted,
breaking pagination beyond the first 10 reverse-fulfillment-orders or
the first 10 reverse-fulfillment-order line items. The visible symptom
is Shpfy Return Lines with missing Location IDs and credit memos that
lose their restock-to-location information.

Replace the three Parameters references in each procedure with
LineParameters - the dictionary that is actually passed to
ExecuteGraphQL.

Fixes AB#636657

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@onbuyuka onbuyuka requested a review from a team as a code owner May 26, 2026 09:06
@github-actions github-actions Bot added the AL: Apps (W1) Add-on apps for W1 label May 26, 2026
@github-actions github-actions Bot added this to the Version 29.0 milestone May 26, 2026
@onbuyuka onbuyuka enabled auto-merge (squash) May 26, 2026 09:22
@onbuyuka onbuyuka merged commit 7af55de into main May 27, 2026
169 of 183 checks passed
@onbuyuka onbuyuka deleted the bugs/636657-returnsapi-cursor branch May 27, 2026 08:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AL: Apps (W1) Add-on apps for W1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants