-
Notifications
You must be signed in to change notification settings - Fork 2k
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
feat(sync): support offline commit- [INS-4226] #7811
Conversation
5a844b4
to
0c5999d
Compare
remoteBranches = ( | ||
remoteBranchesCache[workspaceId] || (await vcs.getRemoteBranchNames()) | ||
).sort(); | ||
compare = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it make sense to split these in two try/catch?
My thought is: In case one of them fails and the other works we would at least have the correct value for one of them
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also looking at this part and i have another question, will splitting introduce inconsistency? this seems for avoiding noise when offline, it might be great if we could differentiate different errors.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Previously, we returned an error if any of them failed, and did not show the entrance for sync. Now, I have wrapped the logic that relies on the network in a new try/catch block so that we can get some of the sync data when the request fails or the user is offline. This allows users to use the sync features that do not depend on the network.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you have some other suggestions for error handling?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure I have other thoughts on this. I feel much more confident baed on your comment so LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall lgtm and error handling might worth a bit discussion.
remoteBranches = ( | ||
remoteBranchesCache[workspaceId] || (await vcs.getRemoteBranchNames()) | ||
).sort(); | ||
compare = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also looking at this part and i have another question, will splitting introduce inconsistency? this seems for avoiding noise when offline, it might be great if we could differentiate different errors.
remoteBranches = ( | ||
remoteBranchesCache[workspaceId] || (await vcs.getRemoteBranchNames()) | ||
).sort(); | ||
compare = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure I have other thoughts on this. I feel much more confident baed on your comment so LGTM
7cf80e6
to
04a2cce
Compare
Support offline commit for Insomnia cloud sync.