RBoy
(RBoy)
4 Gennaio 2026, 7:23pm
1
Buon anno nuovo!
Ho trovato un bug secondario dopo che il bug originale è stato risolto qui:Minor UI bug in LLM Usage page - #2 by zogstrip
Quando la pagina viene caricata, la durata predefinita è l’ultimo mese.
Clicco sul menu a discesa del modello e vedo questo:
Mi sta mostrando tutti i modelli utilizzati nell’ultimo mese.
Ora seleziono uno dei modelli:
Ora clicco su Ultime 24 ore, mi mostra ancora lo stesso elenco (e l’utilizzo):
Questo è sbagliato, sembra che stia memorizzando nella cache il vecchio elenco (e i numeri di utilizzo).
Se aggiorno la pagina e clicco direttamente su ultime 24 ore senza selezionare alcun modello, ora l’elenco a discesa mi mostra l’elenco corretto (e l’utilizzo corrispondente).
1 Mi Piace
Ottima osservazione @RBoy - mi era sfuggito anche come gestire/svuotare la cache quando si cambia il periodo
main ← fix/ai-usage-dropdown-cache
opened 11:04AM - 06 Jan 26 UTC
Follow-up to a1cc09d22d.
The model and feature dropdown lists in the AI Usage… admin page weren't updating when users changed the time period. For example, switching from "Last month" to "Last 24 hours" would still show models that had no usage in the last 24 hours.
The root cause was a race condition in the caching mechanism. The cache was being cleared inside the async `fetchData` method, but tracked property changes in methods like `setPeriodDates` would trigger Glimmer re-renders before the cache was cleared. This caused the stale cached values to be used during re-render.
Additionally, the cache could be populated with empty arrays during initial render before the AJAX response arrived, preventing proper population once data was available.
The fix moves cache invalidation to happen synchronously before any tracked property changes, and only populates the cache when actual data is present. This ensures the dropdown options always reflect the currently selected time period.
Ref - https://meta.discourse.org/t/bug-in-llm-usage-ui/392652