Skip to content
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

Fix undefined node error on save - part 2 #2820

Merged
merged 5 commits into from
Apr 16, 2024

Conversation

t1m0thyj
Copy link
Member

@t1m0thyj t1m0thyj commented Apr 5, 2024

Proposed changes

  • Fixes document being removed from openFiles map prematurely when diff editor is closed
  • Fixes node not found on save when favorited file is opened outside of favorites
  • Adds error handling for case when file is saved and node cannot be found in tree

Release Notes

Milestone: 2.15.3

Changelog: Fixed issue where saving changes to favorited data set or USS file could fail when it is opened outside of favorites

Types of changes

What types of changes does your code introduce to Zowe Explorer?
Put an x in the boxes that apply

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Updates to Documentation or Tests (if none of the other choices apply)

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This checklist will be used as reference for both the contributor and the reviewer

  • I have read the CONTRIBUTOR GUIDANCE wiki
  • PR title follows Conventional Commits Guidelines
  • PR Description is included
  • gif or screenshot is included if visual changes are made
  • yarn workspace vscode-extension-for-zowe vscode:prepublish has been executed
  • All checks have passed (DCO, Jenkins and Code Coverage)
  • I have added unit test and it is passing
  • I have added integration test and it is passing
  • There is coverage for the code that I have added
  • I have tested it manually and there are no regressions found
  • I have added necessary documentation (if appropriate)
  • Any PR dependencies have been merged and published (if appropriate)

Further comments

Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>
Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>
Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>
Copy link

codecov bot commented Apr 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.44%. Comparing base (f3f9ea7) to head (4041d25).

Additional details and impacted files
@@               Coverage Diff               @@
##           maintenance    #2820      +/-   ##
===============================================
+ Coverage        93.29%   93.44%   +0.14%     
===============================================
  Files              103      103              
  Lines            10665    10673       +8     
  Branches          2319     2318       -1     
===============================================
+ Hits              9950     9973      +23     
+ Misses             714      699      -15     
  Partials             1        1              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@zFernand0 zFernand0 left a comment

Choose a reason for hiding this comment

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

would it be ok to rebase this draft against main?
or were we planning on yet another patch release? 😋

@t1m0thyj t1m0thyj added this to the v2.15.3 milestone Apr 9, 2024
Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>
Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>
Copy link

sonarcloud bot commented Apr 11, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@t1m0thyj
Copy link
Member Author

would it be ok to rebase this draft against main? or were we planning on yet another patch release? 😋

I believe we plan another patch release, so I've added this PR to the 2.15.3 milestone 😁

Copy link
Member

@zFernand0 zFernand0 left a comment

Choose a reason for hiding this comment

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

Changes LGTM! 😋
And I'm not getting any cannot read property of undefined (reading ...)

@@ -375,9 +379,13 @@ export async function compareFileContent(
label?: string,
profile?: imperative.IProfileLoaded
): Promise<void> {
node = node ?? TreeProviders.ds.openFiles?.[doc.uri.fsPath] ?? TreeProviders.uss.openFiles?.[doc.uri.fsPath];
Copy link
Member

Choose a reason for hiding this comment

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

Curious if we should also search for the node in the uploadContent method before we check for == null.

Copy link
Member Author

Choose a reason for hiding this comment

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

At the time uploadContent is called, we should have already handled the case where node is null or undefined in saveFile for data sets or saveUSSFile for USS files.

Copy link
Member

@traeok traeok left a comment

Choose a reason for hiding this comment

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

LGTM - thanks @t1m0thyj

Copy link
Contributor

@JillieBeanSim JillieBeanSim left a comment

Choose a reason for hiding this comment

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

Hey all, just adding the changes requested to ask about the Theia test on this branch that are broken? Looks like only the first test passed and the rest fail.

@t1m0thyj
Copy link
Member Author

t1m0thyj commented Apr 16, 2024

Hey all, just adding the changes requested to ask about the Theia test on this branch that are broken? Looks like only the first test passed and the rest fail.

@JillieBeanSim Good catch, in order to fix the Theia tests we'll need to cherry-pick some commits from #2838. Should I create a separate PR that contains just those commits? I don't want to be blocking other PRs going into maintenance branch with failing Theia tests 😋

@JillieBeanSim
Copy link
Contributor

broken Theia tests are not specific to the branch, breakages are already introduced to maintenance branch

@JillieBeanSim JillieBeanSim merged commit 4c08160 into maintenance Apr 16, 2024
25 of 26 checks passed
@JillieBeanSim JillieBeanSim deleted the fix/doc-close-event branch April 16, 2024 17:39
@JillieBeanSim
Copy link
Contributor

JillieBeanSim commented Apr 17, 2024

Hey all, just adding the changes requested to ask about the Theia test on this branch that are broken? Looks like only the first test passed and the rest fail.

@JillieBeanSim Good catch, in order to fix the Theia tests we'll need to cherry-pick some commits from #2838. Should I create a separate PR that contains just those commits? I don't want to be blocking other PRs going into maintenance branch with failing Theia tests 😋

Hey @t1m0thyj no worries, having the fix in other PR for maintenance branch is good and can link the open issue I created to track #2855 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants