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 Refresh button in Unix Attributes View #3354

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

JillieBeanSim
Copy link
Contributor

@JillieBeanSim JillieBeanSim commented Dec 10, 2024

Proposed changes

bug fix for Edit Attributes webview refresh button when changes not applied, reverting the view to original values.
#3238

Release Notes

Milestone: 3.1.0

Changelog: Fixed an issue with edit UNIX file attributes refresh button. #3238

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (non-breaking change which adds or improves functionality)
  • Breaking change (a change that would cause existing functionality to not work as expected)
  • Documentation (Markdown, README updates)
  • Other (please specify above in "Proposed changes" section)

Checklist

General

  • I have read the CONTRIBUTOR GUIDANCE wiki
  • All PR dependencies have been merged and published (if applicable)
  • A GIF or screenshot is included in the PR for visual changes
  • The pre-publish command has been executed:
    • v2 and below: yarn workspace vscode-extension-for-zowe vscode:prepublish
    • v3: pnpm --filter vscode-extension-for-zowe vscode:prepublish

Code coverage

  • There is coverage for the code that I have added
  • I have added new test cases and they are passing
  • I have manually tested the changes

Deployment

  • I have added developer documentation (if applicable)
  • Documentation should be added to Zowe Docs
    • If you're an outside contributor, please post in the #zowe-doc Slack channel to coordinate documentation.
    • Otherwise, please check with the rest of the squad about any needed documentation before merging.
  • These changes may need ported to the appropriate branches (list here):

Further comments

Signed-off-by: Billie Simmons <[email protected]>
@JillieBeanSim JillieBeanSim self-assigned this Dec 10, 2024
@JillieBeanSim JillieBeanSim linked an issue Dec 10, 2024 that may be closed by this pull request
@JillieBeanSim JillieBeanSim added this to the v3.1.0 milestone Dec 10, 2024
@pull-request-size pull-request-size bot added size/L and removed size/M labels Dec 10, 2024
Copy link

codecov bot commented Dec 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.23%. Comparing base (080a8d9) to head (8a5b210).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3354      +/-   ##
==========================================
+ Coverage   93.17%   93.23%   +0.05%     
==========================================
  Files         117      117              
  Lines       12280    12278       -2     
  Branches     2781     2704      -77     
==========================================
+ Hits        11442    11447       +5     
+ Misses        837      830       -7     
  Partials        1        1              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@JillieBeanSim JillieBeanSim marked this pull request as ready for review December 11, 2024 21:08
Copy link

📅 Suggested merge-by date: 12/25/2024

JillieBeanSim and others added 2 commits December 11, 2024 16:12
Copy link
Member

@traeok traeok left a comment

Choose a reason for hiding this comment

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

Thanks for looking into this Billie! I noticed that in some scenarios the Refresh button still does not work, I posted a GIF and some context below.

Comment on lines -48 to -55
this.onUpdateDisposable = this.ussNode.onUpdate(async (node) => {
await this.attachTag(node);
await this.panel.webview.postMessage({
attributes: await this.ussNode.getAttributes(),
name: node.fullPath,
readonly: this.ussApi.updateAttributes == null,
});
this.onUpdateDisposable.dispose();
Copy link
Member

@traeok traeok Dec 12, 2024

Choose a reason for hiding this comment

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

I think we'll still need the onUpdate event listener. Once the node has been updated in the tree, the attributes in the webview are updated because this callback will be fired in getChildren (see line 233 in ZoweUSSNode.ts). Then, on lines 53-57 in this file, the refresh is called on the tree node to get the new attributes.

It seems like removing this causes every other refresh call to work - for example, if I change the permissions in my terminal and then refresh in ZE, the first refresh does not show any changes, but the second one pulls the right permissions:
ZE-EditAttributesRefresh

Also, the onUpdate callback is working as expected in v2. It seems like the onUpdateEmitter might not be firing in v3.

Copy link
Member

Choose a reason for hiding this comment

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

I'm seeing the same behavior as Trae.
Also, the GIF shows that the Apply changes button is enabled the second time the refresh button is clicked, even though nothing the user (I) didn't make changes 😅

@JillieBeanSim JillieBeanSim marked this pull request as draft December 18, 2024 18:41
Copy link

Reminder: This pull request has a merge-by date coming up within the next 24 hours. Please review this PR as soon as possible.

@t1m0thyj @zFernand0 @awharn @SanthoshiBoyina1 @likhithanimma1

@traeok
Copy link
Member

traeok commented Dec 23, 2024

Considering the timing of the holidays, I've "snoozed" (disabled) the merge-by comments until everyone is back in the office.
(It also shouldn't be posting these on draft PRs 😅)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

Edit attributes refresh not updating values
3 participants