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 process ID not being reset after event is emitted #2360

Merged
merged 3 commits into from
Nov 13, 2024

Conversation

t1m0thyj
Copy link
Member

@t1m0thyj t1m0thyj commented Nov 12, 2024

What It Does

This fixes a regression of #2323 where after the onVaultChanged event was ignored because of same process ID, then subsequent onVaultChanged events from external apps would be ignored.

Also updates the cross-spawn package for technical currency.

How to Test

Review Checklist
I certify that I have:

Additional Comments

Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>
Copy link

codecov bot commented Nov 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.27%. Comparing base (53cc0d0) to head (e7ca97e).
Report is 5 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff            @@
##           master    #2360    +/-   ##
========================================
  Coverage   91.27%   91.27%            
========================================
  Files         636      636            
  Lines       18068    18071     +3     
  Branches     3895     3787   -108     
========================================
+ Hits        16491    16494     +3     
  Misses       1576     1576            
  Partials        1        1            

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

Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>
@t1m0thyj t1m0thyj changed the title Fix process ID not reset after event is emitted Fix process ID not being reset after event is emitted Nov 12, 2024
@t1m0thyj t1m0thyj marked this pull request as ready for review November 13, 2024 12:39
Comment on lines +208 to +211
let shouldProcessEvent = eeInst.eventTimes.get(eventName) !== event.eventTime;
eeInst.eventTimes.set(eventName, event.eventTime);
// Checks that event was not triggered by the same process
shouldProcessEvent &&= process.pid !== event.appProcId;
Copy link
Member

Choose a reason for hiding this comment

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

Could lines 208 and 211 be combined? Combining the lines will also allow you to use const instead of let:

const shouldProcessEvent = eeInst.eventTimes.get(eventName) !== event.eventTime && process.pid !== event.appProcId;`

Copy link

sonarcloud bot commented Nov 13, 2024

@t1m0thyj t1m0thyj merged commit cb9e71b into master Nov 13, 2024
19 checks passed
@t1m0thyj t1m0thyj deleted the fix/event-emitter-skip branch November 13, 2024 20:31
@t1m0thyj t1m0thyj added the release-patch Indicates a patch to existing code has been applied label Nov 13, 2024
Copy link

Release succeeded for the master branch. 🎉

The following packages have been published:

  • npm: @zowe/imperative@8.8.2
  • npm: @zowe/cli-test-utils@8.8.2
  • npm: @zowe/core-for-zowe-sdk@8.8.2
  • npm: @zowe/zos-uss-for-zowe-sdk@8.8.2
  • npm: @zowe/provisioning-for-zowe-sdk@8.8.2
  • npm: @zowe/zos-console-for-zowe-sdk@8.8.2
  • npm: @zowe/zos-files-for-zowe-sdk@8.8.2
  • npm: @zowe/zos-logs-for-zowe-sdk@8.8.2
  • npm: @zowe/zosmf-for-zowe-sdk@8.8.2
  • npm: @zowe/zos-workflows-for-zowe-sdk@8.8.2
  • npm: @zowe/zos-jobs-for-zowe-sdk@8.8.2
  • npm: @zowe/zos-tso-for-zowe-sdk@8.8.2
  • npm: @zowe/cli@8.8.2

Powered by Octorelease 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-patch Indicates a patch to existing code has been applied released
Projects
Status: Closed
Development

Successfully merging this pull request may close these issues.

4 participants