Skip to content

[Shopify] Fix payout and dispute sync skipping records in multi-store setups#7633

Merged
onbuyuka merged 3 commits into
mainfrom
bugs/630653-payout-sync-shop-code
Apr 13, 2026
Merged

[Shopify] Fix payout and dispute sync skipping records in multi-store setups#7633
onbuyuka merged 3 commits into
mainfrom
bugs/630653-payout-sync-shop-code

Conversation

@onbuyuka
Copy link
Copy Markdown
Contributor

@onbuyuka onbuyuka commented Apr 10, 2026

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

🤖 Generated with Claude Code

@onbuyuka onbuyuka requested a review from a team as a code owner April 10, 2026 09:54
@github-actions github-actions Bot added the AL: Apps (W1) Add-on apps for W1 label Apr 10, 2026
… 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>
@onbuyuka onbuyuka force-pushed the bugs/630653-payout-sync-shop-code branch from 4b0216c to 45f9f65 Compare April 10, 2026 09:59
@github-actions github-actions Bot added this to the Version 29.0 milestone Apr 10, 2026
@onbuyuka onbuyuka enabled auto-merge (squash) April 10, 2026 11:15
Comment thread src/Apps/W1/Shopify/App/src/Payments/Tables/ShpfyPayout.Table.al
Groenbech96
Groenbech96 previously approved these changes Apr 10, 2026
Comment thread src/Apps/W1/Shopify/App/src/Payments/Tables/ShpfyPayout.Table.al Outdated
Comment thread src/Apps/W1/Shopify/App/src/Payments/Tables/ShpfyPayout.Table.al Outdated
Co-authored-by: Onat Buyukakkus <55088871+onbuyuka@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
AndreiPanko previously approved these changes Apr 10, 2026
Comment thread src/Apps/W1/Shopify/Test/Payments/ShpfyPaymentsTest.Codeunit.al
Co-authored-by: Onat Buyukakkus <55088871+onbuyuka@users.noreply.github.com>
@onbuyuka onbuyuka merged commit 9a90b26 into main Apr 13, 2026
49 checks passed
@onbuyuka onbuyuka deleted the bugs/630653-payout-sync-shop-code branch April 13, 2026 08:20
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>
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>
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.

4 participants