Allow retryable optimistic workspace creation#11130
Conversation
API.write|
I'm going to review this because I've worked on this stuff before and I remember the reason we used |
neil-marcellini
left a comment
There was a problem hiding this comment.
Looking good, one thing to make it even better!
@neil-marcellini WOW good eyes, took me a couple tries to even notice that, good idea to change it to SET 👍 I'll also update the testing instructions to include creation from another workspace, thanks for the review! |
neil-marcellini
left a comment
There was a problem hiding this comment.
Looking good, thanks for the updates. I did notice another bug that we could fix with this PR. If you create a workspace while offline, go back online, and then go offline after the request completes, the workspace is still grayed out.
grayed-out-after.mov
thienlnam
left a comment
There was a problem hiding this comment.
+1 to @neil-marcellini's comments, though in the success data we are setting pendingAction to null so why is the grey UI still showing?
|
@neil-marcellini Hmm I'm unable to reproduce that bug, which request are you referring to specifically? Screen.Recording.2022-09-20.at.3.40.13.PM.mov |
The |
|
Now I'm not able to reproduce that bug 🤷♂️ Idk what happened there. It's probably fine. |
neil-marcellini
left a comment
There was a problem hiding this comment.
Good to go! Thanks.
|
I couldn't test on all platforms because we don't have a good way to test offline mode in our dev environment right now. I might make an issue for that.
|
@neil-marcellini I know what bug you're talking about, where sometimes it doesn't show up as in the gray pending UI right? I think that's actually more due to a different bug with the web app not detecting offline status immediately so it doesn't show unless you are offline. I also think that because it doesn't show the 'You are offline' in other places as well when that happens |
|
@thienlnam looks like this was merged without passing tests. Please add a note explaining why this was done and remove the |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
Tests had passed, this is a bug |
|
🚀 Deployed to staging by @thienlnam in version: 1.2.4-0 🚀
|
|
🚀 Deployed to production by @luacmartins in version: 1.2.4-2 🚀
|
|
@jasperhuangg is there any reason why we are not using Line 119 in d779a20 |
| */ | ||
| function reconnectApp() { | ||
| API.read('ReconnectApp', {policyIDList}, { | ||
| API.read('ReconnectApp', {policyIDListExcludingWorkspacesCreatedOffline}, { |
There was a problem hiding this comment.
The parameter expected in the Web API is policyIDList, not policyIDListExcludingWorkspacesCreatedOffline 😆
Details
This creates workspaces with
API.writeso workspace creation can be retried if created offline. It also excludes fetching workspaces that were created offline when reconnecting the app, since that'll effectively clear out any optimistic values that were initially created locally (see comment inApp.jsdiff for additional context).Untitled.mov
Fixed Issues
$ #10897
Tests and QA Steps
(See above screen recording)
Creation via FAB
Creation via another workspace (perform above FAB steps first)
PR Review Checklist
Contributor (PR Author) Checklist
### Fixed Issuessection aboveTestssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*filesSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)/** comment above it */displayNamepropertythisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)Avataris modified, I verified thatAvataris working as expected in all cases)PR Reviewer Checklist
The Contributor+ will copy/paste it into a new comment and complete it after the author checklist is completed
### Fixed Issuessection aboveTestssectionQA stepssectiontoggleReportand notonIconClick).src/languages/*filesSTYLE.md) were followedAvatar, I verified the components usingAvatarhave been tested & I retested again)/** comment above it */displayNamepropertythisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)Avataris modified, I verified thatAvataris working as expected in all cases)cc @thienlnam @arosiclair