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

EntityList helper component returns every entity if entityIds undefined #63

Open
orther opened this issue Feb 5, 2019 · 1 comment
Open
Assignees
Labels
bug Something isn't working

Comments

@orther
Copy link
Member

orther commented Feb 5, 2019

Bug Report

Current Behavior
Passing undefined to entityIds prop of the EntityList helper component returns all entities for that type. This behavior resulted in app crashing in glorious fashion when every component was passed 1500 entities to render.

Input Code

  • REPL or Repo link if applicable:
<EntityList entityIds={undefined} entityType="worksheetQuestion">
  {questionList => {
    // !!!
    // !!! questionList is array of every entity detail in redux store state `entities.worksheetQuestion`
    // !!!
  }}
</<EntityList>

Expected behavior/code
It should return 0 results and possibly warn in dev console?

Environment

  • uptrend-redux-modules version: [e.g. v0.21.0]
  • node version: [e.g. Node v9.11.1]
  • yarn (or npm) version: [e.g. Yarn v1.6.0]

Possible Solution

Update the EntityList component to short circuit if entityIds is not pass array.

@orther orther added the bug Something isn't working label Feb 5, 2019
@orther orther self-assigned this Feb 5, 2019
@orther
Copy link
Member Author

orther commented Feb 6, 2019

After review the current implementation returns all entities when entittIds is not set (undefined). This behavior should be removed and a boolean prop flag returnAllEntities added to return all entities.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant