zowe/zowe-explorer-vscode

Edit attributes refresh not updating values

Opened this issue · 2 comments

Describe the bug

Edit attributes refresh not updating/reverting values

To Reproduce

Steps to reproduce the behavior:

  1. Go to USS tree view and enter a filter search, locating a file to view Attributes
  2. Right-click on file and select Edit Attributes
  3. Change some values but do not apply, instead click the refresh
  4. See attributes not updated/reverted after refresh

Expected behavior

In this scenario, I would assume the refresh would work similar to cancel updating the webview back to the original values.

Desktop (please complete the following information):

  • OS: macos
  • Zowe Explorer Version: 3.0.1
  • (Optional) Zowe CLI Version:
  • (Optional) Are you using Secure Credential Store?

Additional context

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.

I debugged this for a bit - when clicking the "Refresh" button, the onUpdate event should fire for USS nodes. This event does not fire in v3.0.0 or v3.0.1 after clicking Refresh. Notice that when the button is clicked, the "Last refreshed" timestamp never updates. Since the logic for the onUpdate event listener is never executed, the webview doesn't receive the new attributes and therefore the timestamp is not updated.

This may be due to a regression between v2 and v3 for the getChildren function. The "Edit Attributes" view uses refreshElement for both v2 and v3 to trigger a call to getChildren, updating the node attributes as a result. In v3, however, the getChildren function doesn't end up updating the node attributes and the event is never fired. It's very strange as the children array starts with the child node (as expected), but by the time the function makes the API call, the cached list of children is empty... maybe another race condition?