getSalesSummary CSV drops the name column when the top group is unnamed
還沒有人認領這個 Issue。
評估
- 難度
- 2/5
- 預估耗時
- 1-3 小時
- 新手友好度
- 82/100
- Issue 類型
- 缺陷
- 描述清晰度
- 描述清楚
- 活躍度
- 活躍
- 技術堆疊
- typescript
研究方向
這個 bug 位於 src/tools/getSalesSummary.ts 的 toCsv 中,它僅從 Object.keys(rows[0]) 取得欄位集合。從那裡開始,然後閱讀有條件地加入 name 鍵的分組對應。在 src/tools/tests/sales.test.ts 中加入一個測試,其中只有排名較低的資料列有名稱,並確認它會為沒有名稱的資料列產生一個帶有空儲存格的 name 欄。執行 npm test。
由索引模型根據 Issue 內容生成。
描述
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
- 主要語言
- TypeScript
- 星號
- 5
- 分支
- 2
- PR 合併指標
- 30 天內沒有已合併 PR
環境準備
- 提供 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
TMHSDigital/steam-mcp 的其他 Issue
-
decision feature priority: medium
難度 5/5 一週以上 新手友好度 15/100
TMHSDigital/steam-mcp#60 · 2 則留言 ·
-
decision marketing priority: low
難度 3/5 1-2 天 新手友好度 12/100
TMHSDigital/steam-mcp#50 · 1 則留言 ·
-
documentation marketing priority: medium
難度 2/5 半天 新手友好度 50/100
TMHSDigital/steam-mcp#47 · 1 則留言 ·
-
marketing priority: high
難度 3/5 半天 新手友好度 42/100
TMHSDigital/steam-mcp#46 · 2 則留言 ·
-
難度 4/5 3-5 天 新手友好度 30/100
TMHSDigital/steam-mcp#25 · 1 則留言 ·
查看 TMHSDigital/steam-mcp 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 65/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 62/100
volcengine/OpenViking#8432 ·
維護者通常 1 天內回覆
-
bug
難度 2/5 1-3 小時 新手友好度 74/100
jupyterlab/eslint-plugin#178 · 2 則留言 ·
-
bug from-app needs-triage
難度 2/5 1-3 小時 新手友好度 65/100
nightly-labs/openbot#16303 ·
維護者通常 1 天內回覆
-
難度 1/5 1 小時以內 新手友好度 72/100