Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: ensure auto-workspace creation waits until all parameters are ready#12419

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Parkreiner merged 3 commits intomainfrommes/auto-workspace-fix
Mar 5, 2024

Conversation

Parkreiner
Copy link
Member

@ParkreinerParkreiner commentedMar 4, 2024
edited
Loading

No issue to link – realized we had a bug when I was looking at some of the Slack messages today

Changes made

  • Makes it so that auto workspace creation waits untiluserParametersQuery succeeds with fetching its data before it's allowed to start making a new workspace
    • To be extra, super cautious, I also made it so auto-creation can only ever be kicked off once, no matter what happens in theuseEffect dependency array

Comment on lines +131 to +132
const autoStartReady =
mode === "auto" && (!autofillEnabled || userParametersQuery.isSuccess);
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Defining this outside seemed like the more manageable thing to do, since this needs to evaluate twelve combinations:

  • The value of mode (form, auto, duplicate)
  • The value of autofillEnabled (true or false)
  • The value of userParametersQuery.isSuccess (true or false)

Combining them into a single boolean makes sure the effect only has to worry about three situations:

  1. Mounting render
  2. Value flips from false to true
  3. Value flips from true to false

Copy link
Collaborator

@BrunoQuaresmaBrunoQuaresma left a comment
edited
Loading

Choose a reason for hiding this comment

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

I think it is a good change but I would add a test for this to ensure things are working properly to prevent the bug you mentioned in the description so we don't accidentally remove this code in the future.

@Parkreiner
Copy link
MemberAuthor

@BrunoQuaresma Yeah, that's perfectly reasonable.

I was off today, so I'm going to reclassify this change as a hotfix to make it more clear that it's a small-scale change for now, and get it in faster. And then I'll make a separate PR with the new test assertions (realistically it'll be Sunday before I start working on that)

@ParkreinerParkreiner added siteArea: frontend dashboard hotfix labelsMar 5, 2024
cdr-bot[bot]
cdr-botbot approved these changesMar 5, 2024
Copy link

@cdr-botcdr-botbot left a comment

Choose a reason for hiding this comment

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

This PR is a hotfix and has been automatically approved.

  • ✅ Base is main
  • ✅ Has hotfix label
  • ✅ Head is from coder/coder
  • ✅ Less than 100 lines

@ParkreinerParkreiner merged commita92853c intomainMar 5, 2024
@ParkreinerParkreiner deleted the mes/auto-workspace-fix branchMarch 5, 2024 23:42
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsMar 5, 2024
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@BrunoQuaresmaBrunoQuaresmaBrunoQuaresma approved these changes

@cdr-botcdr-bot[bot]cdr-bot[bot] approved these changes

Assignees

@ParkreinerParkreiner

Labels
siteArea: frontend dashboard
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@Parkreiner@BrunoQuaresma

[8]ページ先頭

©2009-2025 Movatter.jp