diff --git a/doc/api/http_api.adoc b/doc/api/http_api.adoc index 82313c54aa8..19c2839b44d 100644 --- a/doc/api/http_api.adoc +++ b/doc/api/http_api.adoc @@ -654,6 +654,8 @@ _Example returns:_ returns an array of authors who contributed to this pad +The synthetic `a.etherpad-system` author (used internally when content is inserted without an explicit `authorId` — HTTP API `setText`/`appendText`/`setHTML` calls without `authorId`, server-side imports, plugins like `ep_post_data`) is omitted from the returned list. + _Example returns:_ * `{code: 0, message:"ok", data: {authorIDs : ["a.s8oes9dhwrvt0zif", "a.akf8finncvomlqva"]}` diff --git a/doc/api/http_api.md b/doc/api/http_api.md index 35437f23eb1..c9c57bfeb32 100644 --- a/doc/api/http_api.md +++ b/doc/api/http_api.md @@ -698,6 +698,8 @@ return true of false returns an array of authors who contributed to this pad +The synthetic `a.etherpad-system` author (used internally when content is inserted without an explicit `authorId` — HTTP API `setText`/`appendText`/`setHTML` calls without `authorId`, server-side imports, plugins like `ep_post_data`) is omitted from the returned list. + *Example returns:* * `{code: 0, message:"ok", data: {authorIDs : ["a.s8oes9dhwrvt0zif", "a.akf8finncvomlqva"]}` * `{code: 1, message:"padID does not exist", data: null}` diff --git a/src/node/db/API.ts b/src/node/db/API.ts index 38d06297386..a1bf4e6bb63 100644 --- a/src/node/db/API.ts +++ b/src/node/db/API.ts @@ -831,7 +831,13 @@ Example returns: exports.listAuthorsOfPad = async (padID: string) => { // get the pad const pad = await getPadSafe(padID, true); - const authorIDs = pad.getAllAuthors(); + // Pad.SYSTEM_AUTHOR_ID is the synthetic author Etherpad attributes inserts to + // when no authorId is supplied (HTTP API setText/appendText/setHTML without + // authorId, server-side import flows, plugins like ep_post_data). It is an + // implementation detail of changeset bookkeeping, not a real contributor, so + // it should not surface through this public API. + const {Pad} = require('./Pad'); + const authorIDs = pad.getAllAuthors().filter((id: string) => id !== Pad.SYSTEM_AUTHOR_ID); return {authorIDs}; };