-
Notifications
You must be signed in to change notification settings - Fork 8.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Use dub.customer.list to issue dual-sided incentives #18452
Conversation
@steven-tey is attempting to deploy a commit to the cal Team on Vercel. A member of the Team first needs to authorize it. |
Hey there and thank you for opening this pull request! 👋🏼 We require pull request titles to follow the Conventional Commits specification and it looks like your proposed title needs to be adjusted. Details:
|
Graphite Automations"Add consumer team as reviewer" took an action on this PR • (01/03/25)1 reviewer was added to this PR based on Keith Williams's automation. "Add foundation team as reviewer" took an action on this PR • (01/03/25)1 reviewer was added to this PR based on Keith Williams's automation. "Add community label" took an action on this PR • (01/03/25)1 label was added to this PR based on Keith Williams's automation. |
E2E results are ready! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!, waiting for @zomars and @sean-brydon to review it 🙏 .
No dependency changes detected. Learn more about Socket for GitHub ↗︎ 👍 No dependency changes detected in pull request |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like we have some failures:
Expand logs
Duplicate value found in common.json keys: weekly and bookerlayout_week_view
Duplicate value found in common.json keys: already_have_account and already_have_an_account
Duplicate value found in common.json keys: timezone_variable and timezone
Duplicate value found in common.json keys: scheduling_for_your_team and workflow_automation
Duplicate value found in common.json keys: oauth_form_title and oAuth_client_creation_form
Duplicate value found in common.json keys: oauth_form_description and oAuth_client_creation_form_description
Duplicate value found in common.json keys: saml_sso and saml_config
Duplicate value found in common.json keys: advanced_managed_events_description and unified_billing_description
Duplicate value found in common.json keys: org_admin_no_slots|heading and org_admin_no_slots|subject
Duplicate value found in common.json keys: email_team_invite|subject|invited_to_subteam and user_invited_you_to_subteam
Duplicate value found in common.json keys: email_team_invite|heading|invited_to_regular_team and email_no_user_invite_heading_team
Duplicate value found in common.json keys: email_team_invite|content|invited_to_regular_team and email_user_invite_subheading_team
Duplicate value found in common.json keys: create_an_out_of_office and ooo_create_entry_modal
Duplicate value found in common.json keys: always and always_requires_confirmation
Duplicate value found in common.json keys: attendee_timezone_info and attendee_timezone_variable
Duplicate value found in common.json keys: event_start_time_in_attendee_timezone_info and event_start_time_in_attendee_timezone_variable
Duplicate value found in common.json keys: event_end_time_in_attendee_timezone_info and event_end_time_in_attendee_timezone_variable
(node:7632) [DEP0128] DeprecationWarning: Invalid 'main' field in '/home/runner/actions-runner/_work/***.com/***.com/packages/features/ee/billing/package.json' of './index.js'. Please either fix that or report it to the module author
(Use `node --trace-deprecation ...` to show where the warning was created)
Error: require() of ES Module /home/runner/actions-runner/_work/***.com/***.com/node_modules/dub/dist/commonjs/index.js from /home/runner/actions-runner/_work/***.com/***.com/packages/features/auth/lib/dub.ts not supported.
index.js is treated as an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which declares all .js files in that package scope as ES modules.
Instead either rename index.js to end in .cjs, change the requiring code to use dynamic import() which is available in all CommonJS modules, or change "type": "module" to "type": "commonjs" in /home/runner/actions-runner/_work/***.com/***.com/node_modules/dub/package.json to treat all .js files as CommonJS (using .mjs for all ES modules instead).
at packages/features/auth/lib/dub.ts:7
5 | });
6 |
> 7 | // fetch Dub customer using their external ID (ID in our database)
| ^
8 | export const getDubCustomer = async (userId: string) => {
9 | if (!process.env.DUB_API_KEY) {
10 | return null;
at mod.require (/home/runner/actions-runner/_work/***.com/***.com/node_modules/next/dist/server/require-hook.js:64:28)
at Object.<anonymous> (/home/runner/actions-runner/_work/***.com/***.com/packages/features/auth/lib/dub.ts:7:12)
at mod.require (/home/runner/actions-runner/_work/***.com/***.com/node_modules/next/dist/server/require-hook.js:64:28)
at Object.<anonymous> (/home/runner/actions-runner/_work/***.com/***.com/packages/features/ee/workflows/lib/reminders/utils.ts:7:12)
at mod.require (/home/runner/actions-runner/_work/***.com/***.com/node_modules/next/dist/server/require-hook.js:64:28)
at Object.<anonymous> (/home/runner/actions-runner/_work/***.com/***.com/packages/features/ee/workflows/lib/reminders/smsReminderManager.ts:8:14)
at mod.require (/home/runner/actions-runner/_work/***.com/***.com/node_modules/next/dist/server/require-hook.js:64:28)
at Object.<anonymous> (/home/runner/actions-runner/_work/***.com/***.com/packages/lib/server/repository/workflow.ts:9:27)
at mod.require (/home/runner/actions-runner/_work/***.com/***.com/node_modules/next/dist/server/require-hook.js:64:28)
at Object.<anonymous> (/home/runner/actions-runner/_work/***.com/***.com/packages/features/ee/teams/lib/deleteWorkflowRemindersOfRemovedMember.ts:7:17)
at mod.require (/home/runner/actions-runner/_work/***.com/***.com/node_modules/next/dist/server/require-hook.js:64:28)
at Object.<anonymous> (/home/runner/actions-runner/_work/***.com/***.com/packages/features/ee/teams/lib/removeMember.ts:11:47)
at mod.require (/home/runner/actions-runner/_work/***.com/***.com/node_modules/next/dist/server/require-hook.js:64:28)
at Object.<anonymous> (/home/runner/actions-runner/_work/***.com/***.com/packages/lib/server/repository/team.ts:12:44)
at mod.require (/home/runner/actions-runner/_work/***.com/***.com/node_modules/next/dist/server/require-hook.js:64:28)
at Object.<anonymous> (/home/runner/actions-runner/_work/***.com/***.com/packages/lib/server/queries/teams/index.ts:20:13)
at mod.require (/home/runner/actions-runner/_work/***.com/***.com/node_modules/next/dist/server/require-hook.js:64:28)
at Object.<anonymous> (/home/runner/actions-runner/_work/***.com/***.com/packages/features/ee/sso/lib/saml.ts:8:14)
at mod.require (/home/runner/actions-runner/_work/***.com/***.com/node_modules/next/dist/server/require-hook.js:64:28)
at Object.<anonymous> (/home/runner/actions-runner/_work/***.com/***.com/apps/web/playwright/saml.e2e.ts:4:13)
at mod.require (/home/runner/actions-runner/_work/***.com/***.com/node_modules/next/dist/server/require-hook.js:64:28)
Error: Process completed with exit code 1.
Head branch was pushed to by a user without write access
@zomars I removed the comment, let's see if it works now |
I don't think it's because the comment. But we'll see... |
@steven-tey Probably best to focus on the createMany PR first as that kind-off builds on this; but that PR has some build issues with regards to CommonJS - I expect this one has also (but doesn't get to that stage as there are still type errors) - the other PR fixes the type errors in this PR - drafting. |
What does this PR do?
This PR uses Dub's
customer.list
API to get the corresponding discount code for a referred user (if it exists).Mandatory Tasks (DO NOT REMOVE)
How should this be tested?
Test the Stripe checkout flow to make sure everything runs as expected.