Skip to content

Inconsistent use of history leads to redundant rendering #130

@karger

Description

@karger

It appears that the standard design for views is a "reconstruct" method that gets called when they need to be regenerated based on changes to the underlying collection. This reconstruct method is called through two different pathways:

  1. via an "onItemsChanged" event that is fired whenever the underlying collection changes
  2. via an "importState" method that is fired by the history mechanism whenever the history state changes.

Right now, it seems that a change to the collection via a facet interaction causes both a direct change in the collection and a change to the history state, so the reconstruct method gets called twice for each collection change. This makes exhibit twice as slow, and also introduces some bugs due to races between the two rerenders. For example, in the tabular view, changing the collection resets the paginated page to zero (important if the number of items shrinks so you don't see an empty page) but importState does not. When importState runs first, you end up with a view showing no results because you're on the wrong page.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions