You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(6194): correct API param + document compactPad in http_api docs
The 1.3.1 entry in APIHandler registered `['padID', 'authorId']`, but
`API.compactPad` takes `(padID, keepRevisions)` and the CLI sends a
`keepRevisions` query param. APIHandler.handle dispatches by URL field
name, so the previous wiring silently dropped `keepRevisions` and never
ran the keep-last branch over HTTP.
- Register `['padID', 'keepRevisions']` so the handler forwards the
CLI/HTTP arg into the API function.
- Add HTTP-level dispatch tests that hit `/api/1.3.1/compactPad` with
and without `keepRevisions`. The direct `api.compactPad()` tests
bypass the handler and would have missed this regression.
- Document compactPad in `doc/api/http_api.md` and `http_api.adoc`,
and bump the documented latest version from 1.3.0 to 1.3.1 to match
`latestApiVersion`.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: doc/api/http_api.adoc
+17-1Lines changed: 17 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -65,7 +65,7 @@ Portal submits content into new blog post
65
65
=== Usage
66
66
67
67
==== API version
68
-
The latest version is `1.3.0`
68
+
The latest version is `1.3.1`
69
69
70
70
The current version can be queried via /api.
71
71
@@ -588,6 +588,22 @@ _Example returns:_
588
588
* `{code: 0, message:"ok", data: null}`
589
589
* `{code: 1, message:"padID does not exist", data: null}`
590
590
591
+
==== compactPad(padID, [keepRevisions])
592
+
* API >= 1.3.1
593
+
594
+
collapses the pad's revision history to reclaim database space (issue #6194). Wraps the same `Cleanup` helper that powers the admin-settings UI, so admins can trigger compaction over the public API or via `bin/compactPad` without going through the admin UI.
595
+
596
+
When `keepRevisions` is omitted (or null), all history is collapsed into a single base revision that reproduces the current pad text — equivalent to a freshly-imported pad. When set to a positive integer N, the pad keeps only its last N revisions.
597
+
598
+
Pad text and chat are preserved in both modes. Saved-revision bookmarks are cleared. *This operation is destructive — export the pad first via `getEtherpad` if you need a backup.*
Copy file name to clipboardExpand all lines: doc/api/http_api.md
+16-1Lines changed: 16 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -98,7 +98,7 @@ Portal submits content into new blog post
98
98
## Usage
99
99
100
100
### API version
101
-
The latest version is `1.3.0`
101
+
The latest version is `1.3.1`
102
102
103
103
The current version can be queried via /api.
104
104
@@ -619,6 +619,21 @@ moves a pad. If force is true and the destination pad exists, it will be overwri
619
619
*`{code: 0, message:"ok", data: null}`
620
620
*`{code: 1, message:"padID does not exist", data: null}`
621
621
622
+
#### compactPad(padID, [keepRevisions])
623
+
* API >= 1.3.1
624
+
625
+
collapses the pad's revision history to reclaim database space (issue #6194). Wraps the same `Cleanup` helper that powers the admin-settings UI, so admins can trigger compaction over the public API or via `bin/compactPad` without going through the admin UI.
626
+
627
+
When `keepRevisions` is omitted (or null), all history is collapsed into a single base revision that reproduces the current pad text — equivalent to a freshly-imported pad. When set to a positive integer N, the pad keeps only its last N revisions.
628
+
629
+
Pad text and chat are preserved in both modes. Saved-revision bookmarks are cleared. **This operation is destructive — export the pad first via `getEtherpad` if you need a backup.**
0 commit comments