Skip to content

Commit 3757bec

Browse files
chore: remove export_count legacy alias from export state API
Complete the export_count migration by removing the duplicate field from GET /api/export/state and updating the bundled SPA, tests, and docs to use last_export_session_count only. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 44942f9 commit 3757bec

6 files changed

Lines changed: 5 additions & 9 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
1717

1818
- README notes that the server enforces the debug + host safety rule at startup
1919

20-
### Deprecated
20+
### Removed
2121

22-
- `export_count` on `GET /api/export/state` (documented only; still returned). Use `last_export_session_count`. Removal planned in a follow-up release per [deprecation policy](docs/deprecation-policy.md).
22+
- `export_count` on `GET /api/export/state` — use `last_export_session_count` (deprecated since policy PR; bundled SPA updated in same release)
2323

2424
[Unreleased]: https://github.com/cppalliance/claude-code-chat-browser/compare/f70505982d435f8b1f754cb18c0c9f65609f11b4...HEAD

api/export_api.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ def get_export_state() -> FlaskReturn:
6969
"last_export_time": state.get("lastExportTime"),
7070
# Sessions exported in the last completed bulk export (not a lifetime total).
7171
"last_export_session_count": n,
72-
"export_count": n,
7372
}
7473
)
7574

docs/api-reference.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -326,13 +326,11 @@ Read-only snapshot of bulk-export state persisted under `~/.claude-code-chat-bro
326326
|-------|------|-----------|-------------|
327327
| `last_export_time` | string \| null | stable | ISO timestamp of last completed bulk export |
328328
| `last_export_session_count` | integer | stable | Sessions in last bulk export run |
329-
| `export_count` | integer | deprecated | Legacy alias of `last_export_session_count`; prefer `last_export_session_count` in new code (still returned for SPA compatibility; removal per [deprecation-policy.md](deprecation-policy.md)) |
330329

331330
```json
332331
{
333332
"last_export_time": "2026-05-20T18:42:11.123456",
334-
"last_export_session_count": 17,
335-
"export_count": 17
333+
"last_export_session_count": 17
336334
}
337335
```
338336

static/js/projects.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export async function showProjects() {
6161
const d = new Date(exportState.last_export_time);
6262
if (!isNaN(d.getTime())) {
6363
hasPreviousExport = true;
64-
const sessionCount = Math.max(0, parseInt(exportState.last_export_session_count ?? exportState.export_count ?? 0, 10) || 0);
64+
const sessionCount = Math.max(0, parseInt(exportState.last_export_session_count ?? 0, 10) || 0);
6565
lastExportHtml = `<p class="text-muted text-sm">Last export: ${d.toLocaleString()} (${sessionCount} sessions in last export)</p>`;
6666
}
6767
}

tests/test_api_routes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def test_export_state_defaults(client_empty):
7070
resp = client_empty.get("/api/export/state")
7171
assert resp.status_code == 200
7272
body = resp.get_json()
73-
assert "export_count" in body
73+
assert "last_export_session_count" in body
7474

7575

7676
def test_bulk_export_empty_projects_returns_422(client_empty):

tests/test_export_api_bulk.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,4 +86,3 @@ def test_export_state_json_fields(isolated_state):
8686
assert resp.status_code == 200
8787
body = resp.get_json()
8888
assert body["last_export_session_count"] == 5
89-
assert body["export_count"] == 5

0 commit comments

Comments
 (0)