getSalesSummary CSV drops the name column when the top group is unnamed
Nessuno ha ancora preso questa issue.
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
- typescript
Direzione di ricerca
Il bug è in toCsv in src/tools/getSalesSummary.ts, che prende il suo insieme di colonne solo da Object.keys(rows[0]). Parti da lì, poi leggi la mappatura dei gruppi che aggiunge condizionalmente la chiave name. Aggiungi un test in src/tools/tests/sales.test.ts in cui solo una riga di rango inferiore ha un nome, e conferma che restituisce una colonna name con una cella vuota per la riga senza nome. Esegui npm test.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
steam_getSalesSummary with format: "csv" takes its columns from the first row only. When the top group has no name but later groups do, the name column is left out of the whole CSV.
Where
src/tools/getSalesSummary.ts(toCsv:const cols = Object.keys(rows[0]);)src/tools/getSalesSummary.ts(group mapping:...(name ? { name } : {}))
Details
function toCsv(rows: Array<Record<string, unknown>>): string {
if (rows.length === 0) return "";
const cols = Object.keys(rows[0]);
...
}
Each group only gets a name key when app_info, package_info, or country_info named it. Rows are sorted by net revenue, so whether the CSV has a name column depends on whether the top earner happened to be named. If row 0 is named and others are not, those get an empty cell, which is fine; the reverse loses every name.
Impact
Low. Steam normally returns names for the countries, apps, and packages on the page, so this needs an unnamed group at the top. When it happens, a spreadsheet export silently drops the names column.
Steps to reproduce
- Stub
GetDetailedSalesso the top-revenue row'scountry_codehas nocountry_infoentry and a smaller row's does. - Call
steam_getSalesSummary { start_date, format: "csv" }. - The header has no
namecolumn.
Suggested fix
Build cols as the union of keys across all rows, in first-seen order, or always set name (empty string when unknown) so every row has the same keys.
Acceptance criteria
- A test where only a lower row is named produces a
namecolumn with that name and an empty cell for the unnamed row.
Getting started
- Relevant files:
src/tools/getSalesSummary.ts,src/tools/__tests__/sales.test.ts - How to run tests:
npm test
Filed by repo-audit/fix-issues at a23ec21. Severity: low. Effort: S. audit-key: bug|src/tools/getSalesSummary.ts|toCsv
- Lingua principale
- TypeScript
- Stelle
- 5
- Fork
- 2
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Include un Dockerfile o un 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 TMHSDigital/steam-mcp
-
decision feature priority: medium
Difficoltà 5/5 Più di una settimana Idoneità per principianti 15/100
TMHSDigital/steam-mcp#60 · 2 commenti ·
-
decision marketing priority: low
Difficoltà 3/5 1-2 giorni Idoneità per principianti 12/100
TMHSDigital/steam-mcp#50 · 1 commento ·
-
documentation marketing priority: medium
Difficoltà 2/5 Mezza giornata Idoneità per principianti 50/100
TMHSDigital/steam-mcp#47 · 1 commento ·
-
marketing priority: high
Difficoltà 3/5 Mezza giornata Idoneità per principianti 42/100
TMHSDigital/steam-mcp#46 · 2 commenti ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 30/100
TMHSDigital/steam-mcp#25 · 1 commento ·
Tutte le issue di TMHSDigital/steam-mcp
Issue simili
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Payment safety page: explain 'preimage' and 'claim' and name the cross-chain open state preciselyApertacontributors-section
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
DACS-Agent-commerce/Community#366 ·
I maintainer di solito rispondono entro 1 giorno
-
bug os:Windows
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
electron-userland/electron-builder#10657 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno