[Shopify] Fix wrong dictionary used for pagination cursor in ReturnsAPI#8309
Merged
Conversation
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>
darjoo
approved these changes
May 27, 2026
gggdttt
approved these changes
May 27, 2026
This was referenced May 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 toCommunicationMgt.ExecuteGraphQL— but they were writing theAftercursor into the module-levelParametersdictionary instead.As a result the
{{After}}placeholder inGetNextReverseFulfillmentOrders.graphqlandGetNextReverseFulfillmentOrderLines.graphql(both substituted fromLineParameters) 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
Parametersreferences in each procedure withLineParameters— the dictionary that is actually passed toExecuteGraphQL. Six lines changed total.Why no test
There is no existing unit-test coverage for
GetReturnLocations/GetReturnLocationsFromReturnFulfillOrderinsrc/Apps/W1/Shopify/Test. A pagination test would need new mock-GraphQL fixtures that simulate thepageInfo.hasNextPagecontract for thereverseFulfillmentOrdersconnection 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