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 error showing when opening a job file for extenders #1701

Merged
merged 12 commits into from May 10, 2022

Conversation

rudyflores
Copy link
Contributor

@rudyflores rudyflores commented Mar 21, 2022

Signed-off-by: Rudy Flores 68666202+rudyflores@users.noreply.github.com

Proposed changes

Fix an issue where a job file is open and an error is shown mentioning the text document was not able to be shown even though it is open successfully for extenders.

Release Notes

Milestone:

Changelog: Fix error displayed when opening a job file for extenders

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)

Reminder

After a PR is merged into the master branch, create a PR from master to the next branch resolving any conflicts.

Further comments

If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...

Signed-off-by: Rudy Flores <68666202+rudyflores@users.noreply.github.com>
@rudyflores rudyflores self-assigned this Mar 21, 2022
JillieBeanSim
JillieBeanSim previously approved these changes Mar 22, 2022
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.

I was able to recreate the issue in CRW with the marketplace version and tested with this branch and the issue is fixed. Thanks @rudyflores for your work on this

@JillieBeanSim JillieBeanSim changed the base branch from master to next April 15, 2022 18:12
@JillieBeanSim JillieBeanSim self-requested a review April 15, 2022 18:12
@JillieBeanSim
Copy link
Contributor

merged in next and rebased the PR

@rudyflores rudyflores changed the base branch from next to master April 29, 2022 15:43
phaumer
phaumer previously approved these changes May 4, 2022
Copy link
Member

@phaumer phaumer left a comment

Choose a reason for hiding this comment

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

This is a fix that will quickly remove the error message, but the solution is not very robust as it just looks for an English substring of the error message.

We can merge it for a quick fix, but a the same time we should fix the root cause of the problem to avoid these errors all together.

One suspicion I have is that the format of the URI might work with VS Code, but causes issues in Theia/Che because it is not a regular URI. When I serialize one in the debugger it looks like this:

zosspool:DBB.STC00021.JESMSGLG?["zosdevtestexp22.rseapi",{"id":2,"ddname":"JESMSGLG","procstep":"","record-count":"2","stepname":"JES2","jobid":"STC00021","jobname":"DBB"}]#1651622167209

Perhaps the solution is to revise the uri schema used for spool files?

packages/zowe-explorer/src/job/actions.ts Outdated Show resolved Hide resolved
const isTextDocActive =
vscode.window.activeTextEditor.document.uri?.path === `${spool.jobname}.${spool.jobid}.${spool.ddname}`;

if (String(error.message).includes("Failed to show text document") && isTextDocActive) {
Copy link
Member

Choose a reason for hiding this comment

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

Will this work if the user works in a different language (as Theia is now localized)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You have a good point here, might have to look into how I could fetch that error localized and check for it...

Copy link
Contributor

Choose a reason for hiding this comment

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

Check if vscode api defines that error as an error code and then check against that code. The message string will likely change in the future.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

After checking it seems like VS Code does not have error codes specific to this issue :/

Signed-off-by: Rudy Flores <68666202+rudyflores@users.noreply.github.com>
@rudyflores rudyflores requested a review from phaumer May 9, 2022 16:40
@zFernand0 zFernand0 mentioned this pull request May 10, 2022
4 tasks
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.

LGTM! thanks @rudyflores, I don't see any errors opening job files with the workaround

@JillieBeanSim JillieBeanSim merged commit 675579a into master May 10, 2022
@JillieBeanSim JillieBeanSim deleted the jobs-file-open-error branch May 10, 2022 17:47
@zFernand0 zFernand0 mentioned this pull request Jul 5, 2022
55 tasks
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.

None yet

4 participants