Description
Describe the bug
There are two parts to this bug:
- The keybinding to open it does not work
- The function itself does not work (special edge case!)
Part 1
When I use the keybinding ctrl+alt+r to run the command zowe.openRecentMember
, nothing happens.
However, the keybinding (ctrl+alt+p) does work for its cousin, the command zowe.searchInAllLoadedItems
, despite their entries in package.json being identical.
For the benefit of the doubt, I temporarily switched the zowe.searchInAllLoadedItems command to run the openRecentMemberPrompt function, and when pressing that keybind (ctrl+alt+p), it opened fine.
Perhaps some kind of key conflict? These are my keys:
Part 2
Once I got the function running using that temporary switch as above, the menu would appear with all the files in my history as expected, however, when selecting a file, I always get the warning message Cannot read properties of undefined (reading 'pattern')
.
I debugged the issue and found that the sessionNode
was not being found in my profile, which dropped through the code as null and eventually lead to this warning. sessionNode
is not being found in my profile because my profile name is now simply different to how it is in the file history, which is where the recent files quick pick gets its items from.
Much easier to show a screenshot, so here, you can see that my current profile name is zosmf_zxplore
, while the profile name that is being expected, is zxplore
.
However, you may notice, that in the above screenshot, the USS file in history and my USS profile name is the same. So why is it still not working then?
Because of a seperate oversight in the code:
The file history stores the profile name in all caps, while my profile name is in all lower, so it is checking all caps profile name with all lower one and does not find a match, so sessionNode
is also not being found. Notice that this is not an issue for a matching dataset profile though, because it does actually do the lower case conversion for both first!
To Reproduce
Steps to reproduce the behavior:
- Open a profile
- Use ctrl+alt+r
- See that nothing happens
Expected behavior
For part 1: The open recent members prompt to appear.
For part 2: Proper handling of finding the sessionNode
.
Screenshots
Desktop (please complete the following information):
- OS: Win10
- Zowe Explorer Version: v3.1.0
- (Optional) Zowe CLI Version:
- (Optional) Are you using Secure Credential Store?
Additional context
Not sure how to fix part 1, but part 2 should be straight forward plus a few test cases too.
For a bit of fun, I found the PR that originally added this function, it is virtually untouched except for someone who must've added that cases handling to the dataset part but not the uss part 😄
Metadata
Assignees
Labels
Type
Projects
Status
Medium Priority
Activity