Commit c5ec215
Fix hook callback called multiple times in registerRoute
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>1 parent da6761a commit c5ec215
1 file changed
Lines changed: 0 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
69 | | - | |
70 | 69 | | |
71 | 70 | | |
72 | 71 | | |
| |||
75 | 74 | | |
76 | 75 | | |
77 | 76 | | |
78 | | - | |
79 | 77 | | |
80 | 78 | | |
81 | 79 | | |
82 | 80 | | |
83 | | - | |
84 | | - | |
85 | 81 | | |
86 | 82 | | |
87 | 83 | | |
88 | 84 | | |
89 | 85 | | |
90 | 86 | | |
91 | | - | |
92 | 87 | | |
93 | 88 | | |
94 | 89 | | |
| |||
117 | 112 | | |
118 | 113 | | |
119 | 114 | | |
120 | | - | |
121 | 115 | | |
122 | 116 | | |
123 | 117 | | |
| |||
0 commit comments