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

profInfo.updateProperty(propOpts) updates the default profile instead of the system profile in VSCode Extension #1864

Open
davidkjackson54 opened this issue Jul 7, 2023 · 2 comments
Labels
bug Something isn't working priority-medium Not functioning - next quarter if capacity permits severity-medium Bug where workaround exists or that doesn't prevent the usage of Zowe. Just makes it more complex.

Comments

@davidkjackson54
Copy link

davidkjackson54 commented Jul 7, 2023

@t1m0thyj @gejohnston

In my zowe.config.json, I have a default base profile and a couple of system profiles.
One of the system profiles specifies secure[user, password]
I have nothing currently saved in the secure credentials vault.
When I run zowe config secure --gc - I noticed that it always leaves the Default base profile to be prompted last.
In my VSCode Explorer, I prompt and update in a different order, I update the Default Base profile first, then update the System profile.
I am using profInfo.updateProperty as you can see below. There is nothing in propOpts that should affect the update sequence.

const propOpts: IProfInfoUpdatePropOpts = {
            profileType: profile.type,
            profileName: profile.name,
            property: arg.argName,
            value: arg.value,
            setSecure: true,
          };

await profInfo.updateProperty(propOpts); // update the vault
whilst running the VSCode extension in debug mode, I check the vault after each update.
First is the userid, then second is the password for the default - all good so far.

Then I update the system profile - again userid first , then password.
I then check the vault and I am seeing that the default base user and password have been overwritten by the userid and password of the system values but there is no vault entry for the system profile.
So I then added this line to my code:
promptResults = promptResults.reverse();
to flip my array so that the default is now second (last).
I then delete the vault entry in order to rerun my test.

Now when I run it, the update is first done for the system profile - userid and password and then I check the vault and the system profile entries are present for the userid and password.
Then I proceed and let the update now take place for the second entry in my array which is the default base profile entry and it correctly then adds the userid and password for the default.
So basically, when running profInfo.updateProperty, the default profile update must be the last to be updated.
I only fathomed this out simply by watching the running order for zowe.config update --gc so I flipped my array and behold it then worked correctly.
I think this is a bug to be honest as running profinfo.updateProperty should simply take in the 5 parameters - where it specifically calls out the profile type and name.
profileType: profile.type,
profileName: profile.name,
property: arg.argName,
value: arg.value,
setSecure: true,

The order of the profInfo.updateProperty calls should not come into play at that point.

@davidkjackson54 davidkjackson54 added the bug Something isn't working label Jul 7, 2023
@github-actions
Copy link

github-actions bot commented Jul 7, 2023

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.

@JTonda JTonda added bug Something isn't working priority-medium Not functioning - next quarter if capacity permits severity-medium Bug where workaround exists or that doesn't prevent the usage of Zowe. Just makes it more complex. and removed bug Something isn't working labels Jul 10, 2023
@github-actions
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.

@JTonda JTonda transferred this issue from zowe/zowe-cli Jul 10, 2023
@awharn awharn transferred this issue from zowe/imperative Nov 13, 2023
@adam-wolfe adam-wolfe mentioned this issue Jan 4, 2024
26 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-medium Bug where workaround exists or that doesn't prevent the usage of Zowe. Just makes it more complex.
Projects
Status: Medium Priority
Development

No branches or pull requests

2 participants