Skip to content

Add the ability to cancel metrics fetches #242

@rmars

Description

@rmars

Currently, we make a metrics request every pollingInterval, but if we navigate away from a certain page, there's no way to indicate that we don't need the data from that request anymore. This causes the returned data to trigger a setState when we're not using that component anymore, triggering react warnings (#157).

We should:

  • wrap our fetches in a cancellable promise
  • cancel any current requests and issue a new metrics request as soon as the metricsWindow changes (button click)

Helpful article:
https://reactjs.org/blog/2015/12/16/ismounted-antipattern.html

This will fix #157.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions