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: Add refresh_token placeholder when parsing refresh token responses #11862

Merged
merged 5 commits into from
Oct 17, 2023

Conversation

joeauyeung
Copy link
Contributor

What does this PR do?

When fetching new access tokens from OAuth apps not every response included a new refresh token. As a part of credential syncing a refresh token placeholder was added assuming that normal access token responses would already contain a refresh token. This PR only adds the placeholder if credential syncing is enabled.

This issue was first noticed in Outlook but should apply to other apps.

Fixes # (issue)

Requirement/Documentation

  • If there is a requirement document, please, share it here.
  • If there is ab UI/UX design document, please, share it here.

Type of change

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

How should this be tested?

  • Install Outlook
  • In the DB set the expiry date to in the past to force a refresh
  • In the token response ensure that a refresh token was not passed
  • The refresh token placeholder should not have been added if a refresh token was not present in the MS token response

Mandatory Tasks

  • Make sure you have self-reviewed the code. A decent size PR without self-review might be rejected.

Checklist

  • I haven't added tests that prove my fix is effective or that my feature works
  • I haven't checked if new and existing unit tests pass locally with my changes

@vercel
Copy link

vercel bot commented Oct 12, 2023

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

Name Status Preview Comments Updated (UTC)
ai ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 17, 2023 11:22am
api ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 17, 2023 11:22am
cal-demo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 17, 2023 11:22am
dev ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 17, 2023 11:22am
ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 17, 2023 11:22am
2 Ignored Deployments
Name Status Preview Comments Updated (UTC)
cal ⬜️ Ignored (Inspect) Visit Preview Oct 17, 2023 11:22am
qa ⬜️ Ignored (Inspect) Visit Preview Oct 17, 2023 11:22am

@joeauyeung joeauyeung self-assigned this Oct 12, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Oct 12, 2023

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

@zomars zomars added the core area: core, team members only label Oct 12, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Oct 12, 2023

📦 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! 🙌

@deploysentinel
Copy link

deploysentinel bot commented Oct 12, 2023

Current Playwright Test Results Summary

✅ 162 Passing - ⚠️ 3 Flaky

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

(Last updated on 10/17/2023 11:26:35am UTC)

Run Details

Running Workflow PR Update on Github Actions

Commit: 815ba85

Started: 10/17/2023 11:24:01am UTC

⚠️ Flakes

📄   apps/web/playwright/login.2fa.e2e.ts • 1 Flake

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
2FA Tests should allow a user to enable 2FA and login using 2FA
Retry 1Initial Attempt
1.72% (5) 5 / 291 runs
failed over last 7 days
31.27% (91) 91 / 291 runs
flaked over last 7 days

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

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Popup Tests should be able to reschedule
Retry 1Initial Attempt
9.09% (28) 28 / 308 runs
failed over last 7 days
89.29% (275) 275 / 308 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
3.59% (11) 11 / 306 runs
failed over last 7 days
13.07% (40) 40 / 306 runs
flaked over last 7 days

View Detailed Build Results


Copy link
Member

@zomars zomars left a comment

Choose a reason for hiding this comment

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

Approving. But will leave some things that need to be addressed in a follow up.

This "feels" like constantly patching. We should strive to achieve syncing without having to fiddle with credentials. Avoid introducing more edge cases to be aware of.

If this is absolutely necessary. Then we need tests. Undoubtedly.

Copy link
Contributor

@Udit-takkar Udit-takkar left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core area: core, team members only Medium priority Created by Linear-GitHub Sync
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants