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

[YUNIKORN-2993] Use empty array when stateLog not exists for AppInfo #227

Conversation

jshmchenxi
Copy link
Contributor

@jshmchenxi jshmchenxi commented Dec 5, 2024

What is this PR for?

When stateLog does not exist for some application returned by API /ws/v1/partition/${partitionName}/queue/${queueName}/applications, calling appInfo.setLastStateChangeTime() would trigger the following error:

TypeError: Cannot read properties of undefined (reading 'forEach')
    at wne.setLastStateChangeTime (main.ec6040d2f2dbf6bb.js:1:775934)

We should fall back to empty array for AppInfo.stateLog when it doesn't exist in the API response.

What type of PR is it?

  • - Bug Fix
  • - Improvement
  • - Feature
  • - Documentation
  • - Hot Fix
  • - Refactoring

Todos

What is the Jira issue?

YUNIKORN-2993

How should this be tested?

Manual

Screenshots (if appropriate)

Questions:

  • - The licenses files need update.
  • - There is breaking changes for older versions.
  • - It needs documentation.

When `stateLog` does not exist for some application returned by API `/ws/v1/partition/${partitionName}/queue/${queueName}/applications`, calling `appInfo.setLastStateChangeTime()` would trigger the following error:

```
TypeError: Cannot read properties of undefined (reading 'forEach')
    at wne.setLastStateChangeTime (main.ec6040d2f2dbf6bb.js:1:775934)
```

We should fall back to empty array for `AppInfo.stateLog` when it doesn't exist in the API response.
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 35.71%. Comparing base (10d02a0) to head (4366493).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #227   +/-   ##
=======================================
  Coverage   35.71%   35.71%           
=======================================
  Files           2        2           
  Lines          56       56           
=======================================
  Hits           20       20           
  Misses         33       33           
  Partials        3        3           

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

Copy link
Contributor

@craigcondit craigcondit left a comment

Choose a reason for hiding this comment

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

+1 LGTM.

@jshmchenxi
Copy link
Contributor Author

Thanks! @craigcondit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants