Skip to content

EntityList helper component returns every entity if entityIds undefined #63

@orther

Description

@orther

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.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions