getSalesSummary CSV drops the name column when the top group is unnamed
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 82/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- typescript
Research direction
The bug is in toCsv in src/tools/getSalesSummary.ts, which takes its column set from Object.keys(rows[0]) only. Start there, then read the group mapping that adds the name key conditionally. Add a test in src/tools/tests/sales.test.ts where only a lower-ranked row has a name, and confirm it yields a name column with an empty cell for the unnamed row. Run npm test.
Written by the indexing model from the issue text.
Description
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
- Dominant language
- TypeScript
- Stars
- 5
- Forks
- 2
- PR merge metrics
- No merged PRs in 30d
Getting set up
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from TMHSDigital/steam-mcp
-
decision feature priority: medium
Difficulty 5/5 Over a week Newbie friendliness 15/100
TMHSDigital/steam-mcp#60 · 2 comments ·
-
decision marketing priority: low
Difficulty 3/5 1-2 days Newbie friendliness 12/100
TMHSDigital/steam-mcp#50 · 1 comment ·
-
documentation marketing priority: medium
Difficulty 2/5 Half a day Newbie friendliness 50/100
TMHSDigital/steam-mcp#47 · 1 comment ·
-
marketing priority: high
Difficulty 3/5 Half a day Newbie friendliness 42/100
TMHSDigital/steam-mcp#46 · 2 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 30/100
TMHSDigital/steam-mcp#25 · 1 comment ·
All issues in TMHSDigital/steam-mcp
Similar issues
-
Y2025: QBI forms print a negative taxable income; Form 8995-A lines 14b/14c check the wrong columnOpen
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
readest/readest#7903 · 1 comment ·
Maintainers usually reply within 1 day
-
type: documentation
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Oddmash/oddmash-ui#72 ·
Maintainers usually reply within 1 day
-
bug priority:p3
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
LCNINE/almondyoung-server#1562 ·
Maintainers usually reply within 1 day
-
clawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:session-state issue-rating: 🦞 diamond lobster no-stale P2
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
openclaw/openclaw#204998 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day