Skip to content

fix(payments-ui): Fix circular dependency in assertCartOwnership decorator#20882

Merged
xlisachan merged 1 commit into
mainfrom
subplat_fix-341-3
Jul 16, 2026
Merged

fix(payments-ui): Fix circular dependency in assertCartOwnership decorator#20882
xlisachan merged 1 commit into
mainfrom
subplat_fix-341-3

Conversation

@xlisachan

Copy link
Copy Markdown
Contributor

Because

  • The static import of getSessionUid from @fxa/payments/ui-auth in assertCartOwnership.decorator.ts created a circular dependency: decorator → ui-auth → ui/server → app.ts → nextjs-actions.service → decorator.
  • This caused a TDZ ReferenceError ("Cannot access 'NextJSActionsService' before initialization") on stage, returning 500 for all SSR pages including /subscriptions/manage.

This pull request

  • Changes the @fxa/payments/ui-auth import in the decorator to a dynamic await import(), breaking the circular module evaluation chain.
  • Adds unit tests for the AssertCartOwnership decorator.

Issue that this pull request solves

Closes: (issue number)

Checklist

Put an x in the boxes that apply

  • My commit is GPG signed.
  • If applicable, I have modified or added tests which pass locally.
  • I have added necessary documentation (if appropriate).
  • I have verified that my changes render correctly in RTL (if appropriate).
  • I have manually reviewed all AI generated code.

How to review (Optional)

  • Key files/areas to focus on:
  • Suggested review order:
  • Risky or complex parts:

Screenshots (Optional)

Please attach the screenshots of the changes made in case of change in user interface.

Other information (Optional)

Any other information that is important to this pull request.

…rator

Because:
- The static import of `getSessionUid` from `@fxa/payments/ui-auth` in `assertCartOwnership.decorator.ts` created a circular dependency: decorator → ui-auth → ui/server → app.ts → nextjs-actions.service → decorator.
- This caused a TDZ ReferenceError ("Cannot access 'NextJSActionsService' before initialization") on stage, returning 500 for all SSR pages including /subscriptions/manage.

This pull request:
- Changes the `@fxa/payments/ui-auth` import in the decorator to a dynamic `await import()`, breaking the circular module evaluation chain.
- Adds unit tests for the `AssertCartOwnership` decorator.
@xlisachan
xlisachan requested a review from a team as a code owner July 16, 2026 18:16
@xlisachan
xlisachan merged commit a28d578 into main Jul 16, 2026
17 of 19 checks passed
@xlisachan
xlisachan deleted the subplat_fix-341-3 branch July 16, 2026 18:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants