Skip to content

fix(cancel-subscription): cancel subscription needs reference id#659

Merged
icecrasher321 merged 2 commits intostagingfrom
fix/cancel-sub
Jul 11, 2025
Merged

fix(cancel-subscription): cancel subscription needs reference id#659
icecrasher321 merged 2 commits intostagingfrom
fix/cancel-sub

Conversation

@icecrasher321
Copy link
Collaborator

Description

Cancel Subscription needs reference id.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added tests that prove my fix is effective or that my feature works
  • All tests pass locally and in CI (bun run test)
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules
  • I have updated version numbers as needed (if needed)
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

Security Considerations:

  • My changes do not introduce any new security vulnerabilities
  • I have considered the security implications of my changes

@vercel
Copy link

vercel bot commented Jul 10, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
sim ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 10, 2025 11:16pm
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
docs ⬜️ Skipped (Inspect) Jul 10, 2025 11:16pm

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

Added reference ID support to subscription cancellation functionality to properly handle both individual and team subscription cancellations.

  • Added reference ID handling in apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/settings-modal/components/subscription/components/cancel-subscription.tsx to differentiate between subscription types
  • Implemented session verification to ensure valid user context before cancellation
  • Enhanced error handling with specific checks for subscription and organization state
  • Added detailed logging for better debugging of cancellation flow
  • Integrated with organization and subscription stores for state management

1 file reviewed, 1 comment
Edit PR Review Bot Settings | Greptile

@delve-auditor
Copy link

delve-auditor bot commented Jul 10, 2025

No security or compliance issues detected. Reviewed everything up to af0dcf7.

Security Overview
  • 🔎 Scanned files: 1 changed file(s)
Detected Code Changes
Change Type Relevant files
Refactor ► cancel-subscription.tsx
    Remove optional chaining from cancel subscription logic
    Add reference ID handling for subscription cancellation

Reply to this PR with @delve-auditor followed by a description of what change you want and we'll auto-submit a change to this PR to implement it.

activeOrgId,
})

const result = await betterAuthSubscription.cancel?.({
Copy link
Collaborator

@waleedlatif1 waleedlatif1 Jul 10, 2025

Choose a reason for hiding this comment

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

@icecrasher321 nit: why the ? after .cancel

Copy link
Collaborator

Choose a reason for hiding this comment

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

besides that lgtm

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

removed

@vercel vercel bot temporarily deployed to Preview – docs July 10, 2025 23:13 Inactive
@icecrasher321 icecrasher321 merged commit 7e174f2 into staging Jul 11, 2025
6 checks passed
@waleedlatif1 waleedlatif1 deleted the fix/cancel-sub branch July 14, 2025 21:22
arenadeveloper02 pushed a commit to arenadeveloper02/p2-sim that referenced this pull request Sep 19, 2025
fix(cancel-subscription): cancel subscription needs reference id
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