[Shopify] Fix payout and dispute sync skipping records in multi-store setups#7633
Merged
Conversation
… setups Add Shop Code field to Payout and Dispute tables and filter all sync procedures by shop, preventing the SinceId cursor from crossing stores. Existing records are backfilled on first re-import via the update path. Fixes AB#630653 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
4b0216c to
45f9f65
Compare
Groenbech96
reviewed
Apr 10, 2026
Groenbech96
previously approved these changes
Apr 10, 2026
onbuyuka
commented
Apr 10, 2026
onbuyuka
commented
Apr 10, 2026
Co-authored-by: Onat Buyukakkus <55088871+onbuyuka@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
AL Documentation Audit
Documentation gaps were detected in the following apps:
- Shopify-Connector-Test: 2% documentation coverage
- Shopify-Connector: 81% documentation coverage
To generate documentation, run /al-docs init or /al-docs update using GitHub Copilot CLI or Claude Code.
This review is for awareness to help keep documentation in sync with code changes. It is okay to dismiss this request.
AndreiPanko
previously approved these changes
Apr 10, 2026
onbuyuka
commented
Apr 11, 2026
Co-authored-by: Onat Buyukakkus <55088871+onbuyuka@users.noreply.github.com>
AndreiPanko
approved these changes
Apr 12, 2026
darjoo
approved these changes
Apr 13, 2026
onbuyuka
added a commit
that referenced
this pull request
Apr 14, 2026
… setups (#7633) - Add `Shop Code` field to `Shpfy Payout` (30125) and `Shpfy Dispute` (30155) tables, mirroring the existing pattern on `Shpfy Payment Transaction` - Filter `FindLast()` by Shop Code in `ImportNewPayouts()` and `ImportNewDisputes()` so each store uses its own sync cursor instead of the global max ID - Add shop filtering to `UpdatePendingPayouts()`, `UpdatePaymentTransactionPayoutIds()`, and `UpdateUnfinishedDisputes()` to prevent cross-store API calls - Set `Shop Code` on both insert and update paths in `ImportPayout()` and `ImportDispute()` so existing records are backfilled on first sync after deployment Fixes [AB#630653](https://dynamicssmb2.visualstudio.com/1fcb79e7-ab07-432a-a3c6-6cf5a88ba4a5/_workitems/edit/630653) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
onbuyuka
added a commit
that referenced
this pull request
Apr 14, 2026
… setups (#7633) - Add `Shop Code` field to `Shpfy Payout` (30125) and `Shpfy Dispute` (30155) tables, mirroring the existing pattern on `Shpfy Payment Transaction` - Filter `FindLast()` by Shop Code in `ImportNewPayouts()` and `ImportNewDisputes()` so each store uses its own sync cursor instead of the global max ID - Add shop filtering to `UpdatePendingPayouts()`, `UpdatePaymentTransactionPayoutIds()`, and `UpdateUnfinishedDisputes()` to prevent cross-store API calls - Set `Shop Code` on both insert and update paths in `ImportPayout()` and `ImportDispute()` so existing records are backfilled on first sync after deployment Fixes [AB#630653](https://dynamicssmb2.visualstudio.com/1fcb79e7-ab07-432a-a3c6-6cf5a88ba4a5/_workitems/edit/630653) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
onbuyuka
added a commit
that referenced
this pull request
Apr 14, 2026
… setups (#7633) ## Summary - Add `Shop Code` field to `Shpfy Payout` (30125) and `Shpfy Dispute` (30155) tables, mirroring the existing pattern on `Shpfy Payment Transaction` - Filter `FindLast()` by Shop Code in `ImportNewPayouts()` and `ImportNewDisputes()` so each store uses its own sync cursor instead of the global max ID - Add shop filtering to `UpdatePendingPayouts()`, `UpdatePaymentTransactionPayoutIds()`, and `UpdateUnfinishedDisputes()` to prevent cross-store API calls - Set `Shop Code` on both insert and update paths in `ImportPayout()` and `ImportDispute()` so existing records are backfilled on first sync after deployment Fixes [AB#630653](https://dynamicssmb2.visualstudio.com/1fcb79e7-ab07-432a-a3c6-6cf5a88ba4a5/_workitems/edit/630653) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
onbuyuka
added a commit
that referenced
this pull request
Apr 14, 2026
… setups (#7633) ## Summary - Add `Shop Code` field to `Shpfy Payout` (30125) and `Shpfy Dispute` (30155) tables, mirroring the existing pattern on `Shpfy Payment Transaction` - Filter `FindLast()` by Shop Code in `ImportNewPayouts()` and `ImportNewDisputes()` so each store uses its own sync cursor instead of the global max ID - Add shop filtering to `UpdatePendingPayouts()`, `UpdatePaymentTransactionPayoutIds()`, and `UpdateUnfinishedDisputes()` to prevent cross-store API calls - Set `Shop Code` on both insert and update paths in `ImportPayout()` and `ImportDispute()` so existing records are backfilled on first sync after deployment Fixes [AB#630653](https://dynamicssmb2.visualstudio.com/1fcb79e7-ab07-432a-a3c6-6cf5a88ba4a5/_workitems/edit/630653) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This was referenced Apr 14, 2026
onbuyuka
added a commit
that referenced
this pull request
Apr 17, 2026
…s are connected (#7687) ## Summary Backport of bug #630653 to releases/28.0. Fixes [AB#630995](https://dynamicssmb2.visualstudio.com/1fcb79e7-ab07-432a-a3c6-6cf5a88ba4a5/_workitems/edit/630995) Original PR(s): #7633 Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
onbuyuka
added a commit
that referenced
this pull request
Apr 17, 2026
…s are connected (#7688) ## Summary Backport of bug #630653 to releases/28.x. Fixes [AB#630996](https://dynamicssmb2.visualstudio.com/1fcb79e7-ab07-432a-a3c6-6cf5a88ba4a5/_workitems/edit/630996) Original PR(s): #7633 Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
onbuyuka
added a commit
that referenced
this pull request
Apr 29, 2026
…s are connected (#7686) ## Summary Backport of bug #630653 to releases/27.x. Fixes [AB#630994](https://dynamicssmb2.visualstudio.com/1fcb79e7-ab07-432a-a3c6-6cf5a88ba4a5/_workitems/edit/630994) Original PR(s): #7633 Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
onbuyuka
added a commit
that referenced
this pull request
Apr 29, 2026
…s are connected (#7685) ## Summary Backport of bug #630653 to releases/27.5. Fixes [AB#630993](https://dynamicssmb2.visualstudio.com/1fcb79e7-ab07-432a-a3c6-6cf5a88ba4a5/_workitems/edit/630993) Original PR(s): #7633 Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
onbuyuka
added a commit
that referenced
this pull request
May 27, 2026
On main, the backfill test added by PR #7633 reuses the 2-arg GetRandomPayout(Id, ExternalTraceId) helper introduced by the API 2026-01 uptake (PR #6244), passing a throwaway value for the externalTraceId. On releases/27.x #7633 was backported before the uptake, so the cherry-pick produced two overloaded GetRandomPayout procedures, each with a local 'PayoutGidTxt' Label. AL's translation ID derivation collapses overloads, triggering AL0570. Mirror main: drop the 1-arg overload and have UnitTestImportPayoutBackfillsShopCode call the 2-arg helper. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
onbuyuka
added a commit
that referenced
this pull request
May 27, 2026
…ring Reorder so UnitTestImportPayoutWithExternalTraceId runs before UnitTestImportPayoutBackfillsShopCode and add Initialize()/SetShop(Shop) plus Shop Code assertion to ExternalTraceId test. Matches the structure on main (post #7633), avoiding cross-test 'Any' codeunit and DB state leakage that caused the External Trace Id assertion to fail on 27.x. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Summary
Shop Codefield toShpfy Payout(30125) andShpfy Dispute(30155) tables, mirroring the existing pattern onShpfy Payment TransactionFindLast()by Shop Code inImportNewPayouts()andImportNewDisputes()so each store uses its own sync cursor instead of the global max IDUpdatePendingPayouts(),UpdatePaymentTransactionPayoutIds(), andUpdateUnfinishedDisputes()to prevent cross-store API callsShop Codeon both insert and update paths inImportPayout()andImportDispute()so existing records are backfilled on first sync after deploymentFixes AB#630653
🤖 Generated with Claude Code