message: Query Browser: Fix poller time range
  `now` should have been set immediately before each poller tick. This bug
  caused the query range start and end times to be off by an amount
  approximately equal to current refresh interval.
diff: @@ -534,14 +534,19 @@ const QueryBrowser_: React.FC<QueryBrowserProps> = ({
  }
  }, [timespan]);
  + const tick = () => {
  + if (hideGraphs) {
  + return undefined;
  + }
  +
  // Define this once for all queries so that they have exactly the same time range and X values
  const now = Date.now();
  - const safeFetchQuery = (query: string) => {
  - if (_.isEmpty(query)) {
  - return Promise.resolve();
  - }
  - const url = getPrometheusURL({
  + const allPromises = _.map(queries, (query) =>
  + _.isEmpty(query)
  + ? Promise.resolve()
  + : safeFetch(
  + getPrometheusURL({
  endpoint: PrometheusEndpoint.QUERY_RANGE,
  endTime: endTime || now,
  namespace,
  @@ -549,14 +554,11 @@ const QueryBrowser_: React.FC<QueryBrowserProps> = ({
  samples,
  timeout: '5s',
  timespan: span,
  - });
  - return safeFetch(url);
  - };
  + }),
  + ),
  + );
  - const tick = () =>
  - hideGraphs
  - ? undefined
  - : Promise.all(_.map(queries, safeFetchQuery))
  + return Promise.all(allPromises)
  .then((responses: PrometheusResponse[]) => {
  const newResults = _.map(responses, 'data.result');
  const numDataPoints = _.sumBy(newResults, (r) => _.sumBy(r, 'values.length'));
  @@ -608,6 +610,7 @@ const QueryBrowser_: React.FC<QueryBrowserProps> = ({
  setUpdating(false);
  }
  });
  + };
  // Don't poll if an end time was set (because the latest data is not displayed) or if the graph is
  // hidden. Otherwise use a polling interval relative to the graph's timespan.
  