cal.com icon indicating copy to clipboard operation
cal.com copied to clipboard

Bug/checkbox calendar sync state

Open sean-brydon opened this issue 2 years ago • 11 comments

Fixes: https://github.com/calcom/cal.com/issues/8438

Move calendar switch to local state instead of waiting on async call to change value.

Before CleanShot 2023-05-04 at 10 08 24

After CleanShot 2023-05-04 at 10 35 23

sean-brydon avatar May 04 '23 17:05 sean-brydon

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

Name Status Preview Comments Updated (UTC)
cal ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 9, 2023 9:40am
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
ui ⬜️ Ignored (Inspect) Visit Preview May 9, 2023 9:40am

vercel[bot] avatar May 04 '23 17:05 vercel[bot]

📦 Next.js Bundle Analysis for @calcom/web

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

Three Pages Changed Size

The following pages changed size from the code in this PR compared to its base branch:

Page Size (compressed) First Load % of Budget (350 KB)
/apps/installed/[category] 276.85 KB 427.65 KB 122.19% (🟡 +0.26%)
/getting-started/[[...step]] 415.99 KB 566.79 KB 161.94% (🟡 +0.40%)
/settings/my-account/calendars 251.41 KB 402.2 KB 114.92% (🟡 +0.27%)
Details

Only the gzipped size is provided here based on an expert tip.

First Load is the size of the global bundle plus the bundle for the individual page. If a user were to show up to your website and land on a given page, the first load size represents the amount of javascript that user would need to download. If next/link is used, subsequent page loads would only need to download that page's bundle (the number in the "Size" column), since the global bundle has already been downloaded.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

The "Budget %" column shows what percentage of your performance budget the First Load total takes up. For example, if your budget was 100kb, and a given page's first load size was 10kb, it would be 10% of your budget. You can also see how much this has increased or decreased compared to the base branch of your PR. If this percentage has increased by 20% or more, there will be a red status indicator applied, indicating that special attention should be given to this. If you see "+/-

github-actions[bot] avatar May 04 '23 18:05 github-actions[bot]

Current Playwright Test Results Summary

✅ 112 Passing - ⚠️ 1 Flaky

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

(Last updated on 05/09/2023 09:56:05am UTC)

Run Details

Running Workflow PR Update on Github Actions

Commit: f567a95c8545fe0e9e7013eca4ff2f551fe659f9

Started: 05/09/2023 09:46:35am UTC

⚠️ Flakes

📄   apps/web/playwright/app-store.e2e.ts • 1 Flake

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
App Store - Authed Browse apple-calendar and try to install
Retry 1Initial Attempt
0.37% (1) 1 / 269 run
failed over last 7 days
62.83% (169) 169 / 269 runs
flaked over last 7 days

View Detailed Build Results


deploysentinel[bot] avatar May 04 '23 18:05 deploysentinel[bot]

@sean-brydon this looks much better. should i close this PR https://github.com/calcom/cal.com/pull/8595 then ?

Udit-takkar avatar May 05 '23 07:05 Udit-takkar

@sean-brydon this looks much better. should i close this PR #8595 then ?

Yeah i believe this is a better approach

sean-brydon avatar May 05 '23 07:05 sean-brydon

I think @hariombalhara recommended to not use local states for this? check #8595

vaibhav135 avatar May 05 '23 07:05 vaibhav135

@hariombalhara here is the example below without local state. (I dont like it) CleanShot 2023-05-05 at 15 25 58

I personally much prefer having the switch be responsive as soon as i click it but open to be convinced. This api call doesnt use trpc FYI

@Jaibles design feedback would be welcome here... You expect the switch to work as soon as you click it right

sean-brydon avatar May 05 '23 14:05 sean-brydon

@sean-brydon My reasoning for it is the same as there for the Save button(except that it has a possibly larger payload and can take more time). When you click on the Save button, there is a loader that runs because it is updating something. We wouldn't want save to be considered done when we know it can fail. There are 2 ways we are using toggles in the app.

  • Here toggling it doesn't actually update anything unless you click the Save button later. Screenshot 2023-05-06 at 12 33 26 PM

  • Current case that we are discussing, where toggling it actually updates something. [This case is similar to the Save button] You mentioned that it's not using tRPC, but it's using react-query already so we can do an optimistic update to further improve the experience. That would then match the local state implementation in terms of responsiveness.

hariombalhara avatar May 06 '23 07:05 hariombalhara

@sean-brydon My reasoning for it is the same as there for the Save button(except that it has a possibly larger payload and can take more time). When you click on the Save button, there is a loader that runs because it is updating something. We wouldn't want save to be considered done when we know it can fail. There are 2 ways we are using toggles in the app.

  • Here toggling it doesn't actually update anything unless you click the Save button later.
Screenshot 2023-05-06 at 12 33 26 PM
  • Current case that we are discussing, where toggling it actually updates something. [This case is similar to the Save button] You mentioned that it's not using tRPC, but it's using react-query already so we can do an optimistic update to further improve the experience. That would then match the local state implementation in terms of responsiveness.

Sure i agree with that :) We can do this in a follow up - This is affecting customers now and would like to get this merged so we can get it in for the next retreat

sean-brydon avatar May 06 '23 07:05 sean-brydon

Sure @sean-brydon. Totally makes sense. It's a miss on my part that I didn't notice it's an important fix.

hariombalhara avatar May 06 '23 07:05 hariombalhara

Sure @sean-brydon. Totally makes sense. It's a miss on my part that I didn't notice it's an important fix.

No worries! The delay between api calls is (with no loading state also) is causing users to think the switch just doesnt work currently. Especially on slower connections.

sean-brydon avatar May 06 '23 07:05 sean-brydon