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

ZoweExplorerZosmfApi.getSession returning undefined in cases #3337

Open
Tracked by #3434 ...
JillieBeanSim opened this issue Nov 21, 2024 · 4 comments
Open
Tracked by #3434 ...

ZoweExplorerZosmfApi.getSession returning undefined in cases #3337

JillieBeanSim opened this issue Nov 21, 2024 · 4 comments
Labels
bug Something isn't working priority-medium Not functioning - next quarter if capacity permits severity-low Bug that makes the usage of the Zowe less convenient but doesn't impact key use cases
Milestone

Comments

@JillieBeanSim
Copy link
Contributor

Describe the bug

referenced in PR where sometimes getSession is returning undefined or passed undefined to new VSC Proxy method ProfilesCache.getProfileSessionWithVscProxy. This needs to be investigated and fixed as getSession should always return a zosmf session.

Copy link

Thank you for creating a bug report.
We will investigate the bug and evaluate its impact on the product.
If you haven't already, please ensure you have provided steps to reproduce the bug and as much context as possible.

@JillieBeanSim JillieBeanSim mentioned this issue Nov 21, 2024
15 tasks
@zFernand0
Copy link
Member

You might be able to use a profile like the one below to replicate the problem.
If you don't have a token stored on that profile, we don't add the tokenType to the session

https://github.com/zowe/zowe-explorer-vscode/blob/main/packages/zowe-explorer-api/src/profiles/ZoweExplorerZosmfApi.ts#L73

Thus, we treat it as if it was using basic auth 😋

        "apiml": {
            "type": "zosmf",
            "properties": {
                "host": "lpar.dev",
                "port": 7554,
                "basePath": "/ibmzosmf/api/v1",
                "tokenType": "apimlAuthenticationToken"
            },
            "secure": [
                "tokenValue"
            ]
        },

@JTonda JTonda added priority-medium Not functioning - next quarter if capacity permits severity-low Bug that makes the usage of the Zowe less convenient but doesn't impact key use cases labels Nov 26, 2024
@zowe-robot zowe-robot moved this from New Issues to Medium Priority in Zowe Explorer for VS Code Nov 26, 2024
@JillieBeanSim JillieBeanSim added this to the v3.1.1 milestone Feb 4, 2025
@traeok
Copy link
Member

traeok commented Feb 5, 2025

While this function does return undefined, this appears to be by design:

  • When a profile has an invalid hostname, it fails to create a session for a profile node, and thus the session node property is undefined
  • We have error handling in place to catch any errors from the imperative.Session constructor (as the constructor can throw exceptions)
  • We have checks elsewhere in the codebase to see if the node's session is falsy before continuing

Since the ISession TypeError was resolved in #3428, should we close this as not planned?

@zFernand0
Copy link
Member

Since the ISession TypeError was resolved in #3428, should we close this as not planned?

I'm not opposed to that idea (since it does seem to be by design) 😅

@zFernand0 zFernand0 mentioned this issue Feb 8, 2025
15 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority-medium Not functioning - next quarter if capacity permits severity-low Bug that makes the usage of the Zowe less convenient but doesn't impact key use cases
Projects
Status: Medium Priority
Development

No branches or pull requests

4 participants