getSalesSummary CSV drops the name column when the top group is unnamed
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 2/5
- Geschätzter Aufwand
- 1-3 Stunden
- Anfängerfreundlichkeit
- 82/100
- Issue-Typ
- Bug
- Klarheit
- Klar beschrieben
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- typescript
Rechercherichtung
Der Bug ist in toCsv in src/tools/getSalesSummary.ts, das seine Spaltenmenge nur aus Object.keys(rows[0]) bezieht. Beginne dort und lies dann das Gruppen-Mapping, das den Schlüssel name bedingt hinzufügt. Füge einen Test in src/tools/tests/sales.test.ts hinzu, bei dem nur eine niedriger gerankte Zeile einen Namen hat, und bestätige, dass er eine Spalte name mit einer leeren Zelle für die unbenannte Zeile ergibt. Führe npm test aus.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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
- Vorherrschende Sprache
- TypeScript
- Sterne
- 5
- Forks
- 2
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Entwicklungsumgebung
- Enthält ein Dockerfile oder eine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus TMHSDigital/steam-mcp
-
decision feature priority: medium
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 15/100
TMHSDigital/steam-mcp#60 · 2 Kommentare ·
-
decision marketing priority: low
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 12/100
TMHSDigital/steam-mcp#50 · 1 Kommentar ·
-
documentation marketing priority: medium
Schwierigkeit 2/5 Ein halber Tag Anfängerfreundlichkeit 50/100
TMHSDigital/steam-mcp#47 · 1 Kommentar ·
-
marketing priority: high
Schwierigkeit 3/5 Ein halber Tag Anfängerfreundlichkeit 42/100
TMHSDigital/steam-mcp#46 · 2 Kommentare ·
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 30/100
TMHSDigital/steam-mcp#25 · 1 Kommentar ·
Alle Issues in TMHSDigital/steam-mcp
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
Maintainer antworten meist innerhalb von 1 Tag
-
[Security]Unauthenticated WebSocket JSON.parse Without Error Handling Leads to Process TerminationOffen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 74/100
nocobase/nocobase#11711 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
Maintainer antworten meist innerhalb von 1 Tag
-
Y2025: QBI forms print a negative taxable income; Form 8995-A lines 14b/14c check the wrong columnOffen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 80/100
readest/readest#7903 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag