[BUG]: respect granularity when limiting analytics time-series buckets
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 82/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- javascript
- Área
- analytics
Línea de trabajo
Lee src/services/analytics.js y las pruebas existentes en src/services/analytics.buildTimeSeries.test.js. Comprueba cómo buildTimeSeries gestiona los buckets semanales y mensuales, y cómo las pruebas verifican la cantidad y el orden de los buckets. El trabajo estará terminado cuando los resultados mensuales estén limitados a 12, los semanales a 26 y los resultados sigan ordenados cronológicamente.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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
- Lenguaje dominante
- JavaScript
- Estrellas
- 44
- Forks
- 133
- Merge medio
- 2 d 22 h
- PR fusionados (30 d)
- 10
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de AOSSIE-Org/OrgExplorer
-
[BUG]: Loading skeletons use hardcoded dark colors and appear as dark blocks in light mode on every pagePosiblemente ocupada @g-k-s-03 la tomó hace 4 días. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
AOSSIE-Org/OrgExplorer#326 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
[FEATURE]: Pressing Enter after typing all orgs to search should hit explore.Posiblemente ocupada @Rajvardhan-Singh-Rathore la tomó hace 5 días. Abiertoenhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 79/100
AOSSIE-Org/OrgExplorer#324 · 7 comentarios ·
Los mantenedores suelen responder en 1 día
-
[BUG]: Navigating to a new page preserves the previous scroll positionPosiblemente ocupada @syedbarkath980 la tomó hace 7 días. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
AOSSIE-Org/OrgExplorer#314 ·
Los mantenedores suelen responder en 1 día
-
[FEATURE]: Add Language column in Repository Explorer tableQuizá libre de nuevo @ProgrammerNesi la tomó hace 8 días y no hay ningún pull request abierto. Abiertoenhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
AOSSIE-Org/OrgExplorer#309 · 4 comentarios ·
Los mantenedores suelen responder en 1 día
-
chore(assets): Convert org-explorer-logo.png to SVGQuizá libre de nuevo Un pull request para esta issue se cerró sin fusionarse. Abiertoenhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
AOSSIE-Org/OrgExplorer#301 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
Todos los issues de AOSSIE-Org/OrgExplorer
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
schmayterling/hibi#245 ·
Los mantenedores suelen responder en 1 día
-
factory-active task-identify-harness-labels-done task-identify-issue-type-done
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
vercel/ai#23304 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
bug package:vitest
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
cloudflare/workers-sdk#16255 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Proxy and MCP URLs with an empty authority parse as a different hostPosiblemente ocupada @ericcaiwx-star la tomó hoy. Abiertoclawsweeper:bulk-filed clawsweeper:linked-pr-open clawsweeper:needs-product-decision clawsweeper:no-new-fix-pr clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster P2
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
openclaw/openclaw-enterprise#2384 · 1 comentario · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
Access-request approve silently discards the decider's note (decision_note written only on deny)Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Uuriko/project-room#3378 ·
Los mantenedores suelen responder en 1 día