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

Reading property of undefined when switching repo in activity dashboard #287

Open
nknguyenhc opened this issue Mar 11, 2024 · 0 comments
Open

Comments

@nknguyenhc
Copy link
Contributor

Describe the bug
Cannot read property of undefined (reading 'id')

To Reproduce
Steps to reproduce the behavior:

  1. Go to activity dashboard.
  2. Switch to another repo within activity dashboard.

Note that no activity shows up. However, this is not observed with the following steps:

  1. Go to activity dashboard.
  2. Switch to issues viewer.
  3. Switch back to activity dashboard.

Some activity shows up.

Expected behavior
There should not be any bug as described.

Screenshots
image

Desktop (please complete the following information):

  • OS: Window 10
  • Browser: chrome
  • Version: 1.1.0

Additional context
This might be due to unnecessary call to issueService. The line occurs in issueService::updateLocalStore method:

  private updateLocalStore(issuesToUpdate: Issue[]) {
    const newIssues = { ...this.issues };
    issuesToUpdate.forEach((issue) => {
      newIssues[issue.id] = issue;
    });
    this.issues = newIssues;

    this.issues$.next(Object.values(this.issues));
  }

The given issuesToUpdate parameter is an array of undefineds, i.e. [undefined, undefined, ...]

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

No branches or pull requests

1 participant