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

Remove duplicate jobs for extenders #1780

Merged
merged 5 commits into from May 10, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 15 additions & 0 deletions packages/zowe-explorer/src/job/ZoweJobNode.ts
Expand Up @@ -274,6 +274,21 @@ export class Job extends ZoweTreeNode implements IZoweJobTreeNode {
owner,
prefix
);
/**
* Note: Temporary fix
* This current fix is necessary since in certain instances the Zowe
* Explorer JES API returns duplicate jobs. The following reduce function
* filters only the unique jobs present by comparing the ids of these returned
* jobs.
*/
jobsInternal = jobsInternal.reduce((acc, current) => {
const duplicateJobExists = acc.find((job) => job.jobid === current.jobid);
if (!duplicateJobExists) {
return acc.concat([current]);
} else {
return acc;
}
}, []);
} catch (error) {
await errorHandling(
error,
Expand Down