Página de uso do administrador do Discourse AI - problemas com intervalo de datas personalizado

:information_source: Overview

Discourse AI usage page issues

When using the Discourse AI admin - usage page and the custom date range feature for dates that don’t include the current default range, there is some kind of bug when generating the initial results. One has to actually reselect the date range parameters and refresh twice to get proper results.

Using the Discourse AI admin usage page on ask.discourse.org for example, if I select the date range 2025-07-01T07:00:00Z2025-07-31T07:00:00Z then click the refresh button, I get only partial results that seem to be from a date range a month prior to current date, and the resulting usage numbers are not correct either. I have to select a begin date somewhere in June then refresh, then go select July 1st again and refresh, to get the correct results. But even then, sometimes it doesn’t even render right away and there is only half showing, especially if there are lots of models (this happens on Meta). I have repro’d the same issues on multiple instances.

:walking_woman: Steps to reproduce

  1. Go to admin -> AI -> usage page (myforum/admin/plugins/discourse-ai/ai-usage)
  2. click the Custom... button to use the custom date range selector
  3. select a date range previous to the current default range, for example July 1, 2025 → July 31, 2025, then click the Refresh button
  4. note the resulting incorrect summary numbers and usage chart date range

  5. reselect an earlier begin date, for example June 28th, and click Refresh button again.
  6. reselect the original start date you wanted, in this case July 1, 2025, and click Refresh button yet again.
  7. see correct results!

:white_check_mark: Expected results

Selected custom date range show correct results on first refresh. No need to reselect dates or refresh multiple times.

4 curtidas