[BUG]: respect granularity when limiting analytics time-series buckets
I maintainer di solito rispondono entro 3 giorni
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 82/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- javascript
- Ambito
- analytics
Direzione di ricerca
Leggi src/services/analytics.js e i test esistenti in src/services/analytics.buildTimeSeries.test.js. Verifica come buildTimeSeries gestisce i bucket settimanali e mensili e come i test verificano il numero e l’ordine dei bucket. Il lavoro è completato quando i risultati mensili sono limitati a 12, quelli settimanali a 26 e i risultati restano ordinati cronologicamente.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Bug Description
The buildTimeSeries function in src/services/analytics.js limits its output to the last 12 buckets regardless of the selected granularity.
As a result, the Weekly view displays only approximately 12 weeks of activity (~3 months), while the Monthly view can display up to 12 months of activity. This creates inconsistent historical windows when switching between granularities.
The function already accepts a granularity parameter, but the final .slice(-12) applies the same limit to both monthly and weekly buckets.
Expected Behavior:
- Monthly granularity should retain up to 12 buckets (~12 months).
- Weekly granularity should retain up to 26 buckets (~6 months).
Actual Behavior:
Both granularities are limited to 12 buckets, causing older activity to disappear from the Weekly view.
Proposed Fix
Use a bucket limit based on the selected granularity instead of hardcoding the limit to 12:
const SLICE_COUNT = granularity === 'weekly' ? 26 : 12;
return Object.values(buckets)
.sort((a, b) => a.date.localeCompare(b.date))
.slice(-SLICE_COUNT);
This allows the Weekly view to retain up to 26 buckets while preserving the existing 12-bucket limit for the Monthly view.
Testing
Update src/services/analytics.buildTimeSeries.test.js to verify that:
- Monthly granularity returns at most 12 buckets.
- Weekly granularity returns at most 26 buckets.
- Weekly granularity can return more than 12 buckets when sufficient data is available.
- Results remain sorted chronologically.
Scope
- Implementation:
src/services/analytics.js - Tests:
src/services/analytics.buildTimeSeries.test.js - No UI, layout, or API changes are required.
Steps to Reproduce
- Run the application locally using
npm run dev. - Explore an organisation with sufficient issue or pull request history, such as
AOSSIE-Org. - Navigate to the Analytics page.
- Click Run Complete Analysis to populate the time-series chart.
- Select Monthly granularity and observe the displayed date range.
- Switch to Weekly granularity.
- Observe that the chart displays at most 12 weekly buckets, even when older activity is available.
The issue can also be reproduced by passing more than 12 distinct weekly buckets to buildTimeSeries in src/services/analytics.js.
Logs and Screenshots
No error logs are expected because this is a data truncation issue rather than a runtime error.
A screenshot comparing the Monthly and Weekly analytics views would help demonstrate the inconsistent historical windows.
Relevant implementation: src/services/analytics.js, where the returned buckets are limited using .slice(-12).
Relevant tests: src/services/analytics.buildTimeSeries.test.js.
Environment Details
- OS: Ubuntu 26 LTS
- Browser: Brave (Chromium-based)
- Runtime: Node.js 22.22.1
- Project: AOSSIE-Org/OrgExplorer
- Setup: Local development environment using
npm run dev - Additional context: The issue concerns the time-series bucket limit in
src/services/analytics.js.
Impact
Medium - Feature works but has issues
Code of Conduct
- I have joined the Discord server and will post updates there
- I have searched existing issues to avoid duplicates
- Lingua principale
- JavaScript
- Stelle
- 44
- Fork
- 133
- Merge medio
- 5g 5h
- PR unite (30g)
- 27
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di AOSSIE-Org/OrgExplorer
-
[BUG]: computeHealthScore: NaN when repo.open_issues_count is missing and computeHealthScore: NaN when repo.pushed_at is missing or invalidForse già presa @PrithvijitBose l’ha presa 14 giorni fa. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
AOSSIE-Org/OrgExplorer#287 · 2 commenti ·
I maintainer di solito rispondono entro 3 giorni
-
[BUG]: Analytics page keeps the previous organization's pull request data after exploring a new orgForse già presa @amanbn8 l’ha presa 14 giorni fa. Apertabug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
AOSSIE-Org/OrgExplorer#272 · 3 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 3 giorni
-
[BUG]: Rate Limit Header Coercion to `0` / False Quota ExhaustionForse già presa @Devnil434 l’ha presa 23 giorni fa. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
AOSSIE-Org/OrgExplorer#251 · 2 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 3 giorni
-
[BUG]: CSV exports produce malformed files when fields contain commas or quotesForse già presa @Dotify71 l’ha presa 24 giorni fa. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
AOSSIE-Org/OrgExplorer#245 · 2 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 3 giorni
-
[BUG]: Cache key ignores auth state, causing stale contributor data after adding PATForse già presa @sumitsingh-cyber l’ha presa oggi. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
AOSSIE-Org/OrgExplorer#228 · 2 commenti ·
I maintainer di solito rispondono entro 3 giorni
Tutte le issue di AOSSIE-Org/OrgExplorer
Issue simili
-
Add: EUROTV NEWSApertachannels:add check:passed
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
curriculum documentation quality
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
githubnext/gh-aw-workshop#4638 ·
I maintainer di solito rispondono entro 1 giorno
-
clawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster no-stale P2
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
openclaw/openclaw-enterprise#2571 · 1 commento · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
fabriziosalmi/certmate#1247 ·
I maintainer di solito rispondono entro 1 giorno
-
[guide] docs/metrics/index.md names retired 'Import reference architectures' workflow as the metrics refresh pathForse già presa @hivecommons-hive l’ha presa oggi. Apertaagent/guide documentation hive/covered-by-pr hive/hosted-available-lke648397-260827-5n31
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 70/100
cncf/endusers#1537 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno