Skip to content

Fix hook callback called multiple times in registerRoute#79

Merged
JohnMcLear merged 3 commits intomainfrom
bugfix/callback-fix
Apr 14, 2026
Merged

Fix hook callback called multiple times in registerRoute#79
JohnMcLear merged 3 commits intomainfrom
bugfix/callback-fix

Conversation

@JohnMcLear
Copy link
Copy Markdown
Member

Found during a systematic audit of all Etherpad plugins.

🤖 Generated with Claude Code

JohnMcLear and others added 3 commits April 14, 2026 13:38
The Etherpad hook system expects cb() to be called exactly once per
hook invocation. In registerRoute, cb() was being called inside the
/p/*/feed route handler on every HTTP request (up to 5 times per
request depending on code path), in addition to the correct call at
the end of the hook. This could cause unpredictable behavior in the
hook system. Remove all cb() calls from inside route handlers, keeping
only the single call after all routes are registered.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@JohnMcLear JohnMcLear merged commit 01ddd95 into main Apr 14, 2026
2 checks passed
@JohnMcLear JohnMcLear deleted the bugfix/callback-fix branch April 14, 2026 15:06
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

Successfully merging this pull request may close these issues.

1 participant