Skip to content
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

fix: 500 on forbidden showing up in logs #14636

Merged
merged 3 commits into from
Apr 17, 2024

Conversation

emrysal
Copy link
Contributor

@emrysal emrysal commented Apr 17, 2024

What does this PR do?

When accessing an event type that doesn't exist or doesn't belong to you, redirect back to the /event-types page instead of throwing a 500 error.

Future improvement, show toast or error, but practically this should happen only when intentional.

@graphite-app graphite-app bot requested a review from a team April 17, 2024 14:01
Copy link
Contributor

github-actions bot commented Apr 17, 2024

Thank you for following the naming conventions! 🙏 Feel free to join our discord and post your PR link.

@dosubot dosubot bot added core area: core, team members only event-types area: event types, event-types foundation 🐛 bug Something isn't working labels Apr 17, 2024
@@ -56,8 +56,7 @@ export const eventOwnerProcedure = authedProcedure
})();

if (!isAuthorized) {
console.warn(`User ${ctx.user.id} attempted to an access an event ${event.id} they do not own.`);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We don't need this information - also FORBIDDEN is the right code to throw here.

Copy link

vercel bot commented Apr 17, 2024

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

Name Status Preview Comments Updated (UTC)
platform-starter-kit ❌ Failed (Inspect) Apr 17, 2024 3:42pm
3 Ignored Deployments
Name Status Preview Comments Updated (UTC)
ai ⬜️ Ignored (Inspect) Visit Preview Apr 17, 2024 3:42pm
cal ⬜️ Ignored (Inspect) Visit Preview Apr 17, 2024 3:42pm
calcom-web-canary ⬜️ Ignored (Inspect) Visit Preview Apr 17, 2024 3:42pm

Copy link

graphite-app bot commented Apr 17, 2024

Graphite Automations

"Add foundation team as reviewer" took an action on this PR • (04/17/24)

1 reviewer was added to this PR based on Keith Williams's automation.

Copy link
Contributor

github-actions bot commented Apr 17, 2024

📦 Next.js Bundle Analysis for @calcom/web

This analysis was generated by the Next.js Bundle Analysis action. 🤖

This PR introduced no changes to the JavaScript bundle! 🙌

Copy link

deploysentinel bot commented Apr 17, 2024

Current Playwright Test Results Summary

✅ 302 Passing - ⚠️ 5 Flaky

Run may still be in progress, this comment will be updated as current testing workflow or job completes...

(Last updated on 04/17/2024 03:59:19pm UTC)

Run Details

Running Workflow PR Update on Github Actions

Commit: 881a1b8

Started: 04/17/2024 03:55:15pm UTC

⚠️ Flakes

📄   apps/web/playwright/profile.e2e.ts • 1 Flake

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Update Profile Can update a users email (verification enabled)
Retry 2Retry 1Initial Attempt
5.69% (17) 17 / 299 runs
failed over last 7 days
23.75% (71) 71 / 299 runs
flaked over last 7 days

📄   apps/web/playwright/teams.e2e.ts • 1 Flake

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Teams - NonOrg -- future Team Onboarding Invite Members
Retry 2Retry 1Initial Attempt
7.19% (22) 22 / 306 runs
failed over last 7 days
37.58% (115) 115 / 306 runs
flaked over last 7 days

📄   packages/app-store/routing-forms/playwright/tests/basic.e2e.ts • 1 Flake

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Routing Forms Seeded Routing Form Test preview should return correct route
Retry 1Initial Attempt
0.34% (1) 1 / 294 run
failed over last 7 days
37.07% (109) 109 / 294 runs
flaked over last 7 days

📄   packages/embeds/embed-core/playwright/tests/inline.e2e.ts • 1 Flake

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Inline Iframe Inline Iframe - Configured with Dark Theme
Retry 1Initial Attempt
0.34% (1) 1 / 296 run
failed over last 7 days
53.72% (159) 159 / 296 runs
flaked over last 7 days

📄   apps/web/playwright/integrations-stripe.e2e.ts • 1 Flake

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Stripe integration when enabling Stripe, team credentialId is included
Retry 1Initial Attempt
3.29% (10) 10 / 304 runs
failed over last 7 days
1.32% (4) 4 / 304 runs
flaked over last 7 days

View Detailed Build Results


keithwillcode
keithwillcode previously approved these changes Apr 17, 2024
Copy link
Contributor

@keithwillcode keithwillcode left a comment

Choose a reason for hiding this comment

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

Logic looks good. Some type errors to fix though

@keithwillcode keithwillcode enabled auto-merge (squash) April 17, 2024 14:21
@CarinaWolli
Copy link
Member

type check is still failing @emrysal

@keithwillcode keithwillcode merged commit 0f8a0ea into main Apr 17, 2024
36 of 37 checks passed
@keithwillcode keithwillcode deleted the bugfix/500-error-on-event-type-access-denied branch April 17, 2024 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working core area: core, team members only event-types area: event types, event-types foundation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants