Skip to content

fix: re-render on insights with orgs#11395

Merged
zomars merged 3 commits intomainfrom
fix-insights-re-renders-and-loads-every-endpoint-again-possible-bug-with-state-changing-when-it-shouldnt-11352-cal-2466
Sep 18, 2023
Merged

fix: re-render on insights with orgs#11395
zomars merged 3 commits intomainfrom
fix-insights-re-renders-and-loads-every-endpoint-again-possible-bug-with-state-changing-when-it-shouldnt-11352-cal-2466

Conversation

@alannnc
Copy link
Copy Markdown
Contributor

@alannnc alannnc commented Sep 16, 2023

What does this PR do?

  • When in an org we first loaded user insights data and then when obtaining org details we refetched insights and changed select values. Now we wait to load any insights till we know if user has or not org. So we only see one fetching.
  • Removes double heading on insights introduced earlier.

Fixes #11352

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)
  • I haven't added tests that prove my fix is effective or that my feature works

@linear
Copy link
Copy Markdown

linear Bot commented Sep 16, 2023

@vercel
Copy link
Copy Markdown

vercel Bot commented Sep 16, 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 Sep 18, 2023 7:21pm
api ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 18, 2023 7:21pm
cal 🔄 Building (Inspect) Visit Preview 💬 Add feedback Sep 18, 2023 7:21pm
cal-demo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 18, 2023 7:21pm
dev ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 18, 2023 7:21pm
qa 🔄 Building (Inspect) Visit Preview 💬 Add feedback Sep 18, 2023 7:21pm
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
ui ⬜️ Ignored (Inspect) Visit Preview Sep 18, 2023 7:21pm

@github-actions github-actions Bot added High priority Created by Linear-GitHub Sync insights area: insights, analytics 🐛 bug Something isn't working 👩‍🔬 needs investigation 🚧 wip / in the making This is currently being worked on labels Sep 16, 2023
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Sep 16, 2023

Thank you for following the naming conventions! 🙏

@zomars zomars added the core area: core, team members only label Sep 16, 2023
…oint-again-possible-bug-with-state-changing-when-it-shouldnt-11352-cal-2466
</h3>
<p className="text-default mt-2 hidden text-sm md:block">{t("insights_subtitle")}</p>
</div>
);
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Removed since a change in shell that has the same was introduced recently by a contributor.

const [startDate, endDate] = dateRange;
const { selectedTeamId: teamId, selectedUserId } = filter;

const initialConfigIsReady = !!(initialConfig?.teamId || initialConfig?.userId || initialConfig?.isAll);
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Don't load any trpc till we know if user belongs to an org/team

filter.initialConfig?.userId ||
filter.initialConfig?.isAll
);
if (isInitialSetupAlready) return;
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Only setup initialConfig once.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Sep 16, 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
Copy Markdown

deploysentinel Bot commented Sep 16, 2023

Current Playwright Test Results Summary

✅ 121 Passing - ⚠️ 2 Flaky

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

(Last updated on 09/18/2023 07:23:34pm UTC)

Run Details

Running Workflow PR Update on Github Actions

Commit: b5e0325

Started: 09/18/2023 07:21:06pm UTC

⚠️ Flakes

📄   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% (0) 0 / 295 runs
failed over last 7 days
1.69% (5) 5 / 295 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
2.05% (6) 6 / 292 runs
failed over last 7 days
96.58% (282) 282 / 292 runs
flaked over last 7 days

View Detailed Build Results


@alannnc alannnc requested a review from a team September 18, 2023 19:14
…oint-again-possible-bug-with-state-changing-when-it-shouldnt-11352-cal-2466
Copy link
Copy Markdown
Contributor

@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.

LGTM

@zomars zomars merged commit 56b1243 into main Sep 18, 2023
@zomars zomars deleted the fix-insights-re-renders-and-loads-every-endpoint-again-possible-bug-with-state-changing-when-it-shouldnt-11352-cal-2466 branch September 18, 2023 23:36
ashwintelmore pushed a commit to ashwintelmore/cal.com that referenced this pull request Sep 24, 2023
aar2dee2 pushed a commit to rkreddy99/cal.com that referenced this pull request Sep 27, 2023
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 High priority Created by Linear-GitHub Sync insights area: insights, analytics 🚧 wip / in the making This is currently being worked on

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[CAL-2466] Insights re renders and loads every endpoint again, possible bug with state changing when it shouldn't

2 participants