Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API call appendText ignoring authorId parameter #6873

Open
SteKme opened this issue Feb 18, 2025 · 0 comments
Open

API call appendText ignoring authorId parameter #6873

SteKme opened this issue Feb 18, 2025 · 0 comments

Comments

@SteKme
Copy link

SteKme commented Feb 18, 2025

I can't get Etherpad respect the author ID when appending a text to a pad. The URL parameter looks like completely ignored? The text displayed in the HTML editor of the pad doesn't mark the newly appended text appropriately colored.

Thank You for correcting me or fixing so much!


Repro steps:
http GET calls from the URL address field of a www browser (!!).
-- Note that 'appendText' command allegedly supports http POST as well, I don't know if that would behave differently, though.

create author:
/api/1.2.15/createAuthor?apikey=[API key]&name=Test%20Author&color=#FF00FF
-- save ID of the author returned in JSON of the response
-- NOT SURE - is 'color=#FF00FF' in the URL above the way to set the author's color, please? If this is not the correct way to set the author's color programmatically, then the problem may be that the snippet might get linked to the author, but not marked by a color in the HTML editor?

test author created properly:
/api/1.2.15/getAuthorName?apikey=[API key]&authorID=[authorID]
-- ensure returned JSON's 'data' key stores the expected author's name
-- observe parameter here is 'authorID', whereas appendText call's parameter is 'authorId' !

create a new pad, generate some suitable padID
/api/1.2.15/createPad?apikey=[API key]&authorId=[authorID]&padID=[padID]

append some text:
/api/1.2.15/appendText?apikey=[API key]&authorId=[authorID]&padID=[padID]&text=TESTappendTEXT
observe in the HTML editor that the text gets appended. In my case, the text is not colored.
replace actual actorID in the url with some nonsense and retry. Observe the text is appended anyway, ignoring wrong authorId.
/api/1.2.15/appendText?apikey=[API key]&authorId=[someMessyID]&padID=[padID]&text=TESTappendTEXT

Proof programatically appended text isn't attributed to the author:

  • create a fresh pad and append one text block via the API call
  • go to the HTML editor of the pad
  • open HISTORY tool
  • observe Authors at the top left of the window. The author of the API appended snippet should have been listed, but it is not in my case.

Expected behavior

  • programmatically created author can get the color assigned
  • appendText API call shall respect the actorId parameter and attribute the just appended text snippet do the given author, making the text colored by the author's color.

Etherpad 2.2.7, using postgresql on Windows
Nodejs 22.14.0
npm 11.1.0
setup barebone, nothing installed aside of the just downloaded base installation from the etherpad's web site.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant