-
Notifications
You must be signed in to change notification settings - Fork 48
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
fix missing broadcast to all users #141
Conversation
commentManager.js
Outdated
padId = await readOnlyManager.getPadId(padId); | ||
}; | ||
// We might need to change readOnly PadIds to Normal PadIds | ||
var padIds = await readOnlyManager.getIds(padId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed each occurence of readOnlyManager to use the getIds
method. That way both ids are available independent of the given input id.
Really good stuff, think it's worth putting some test coverage in just so I can be sure it doesn't get broken by someone else in the future? 👍 |
Also, does read only before this PR = no comments or does it mean comments are visible but they don't update until refresh? If it's the latter that's fine.. If it's the former then we would need to add this under a setting. Having read only where comments aren't visible may be ideal to some. |
for reference: #68 This comment I am not really sure what happens prior to both my PRs. When this PR gets merged, both "worlds" can see each other and even can edit each others comments. I am not sure if this is desired behaviour. Basically any "guest" (read-only) can edit and delete "admin" comments. I think #125 plays a role here. So to fix this entirely I think we need to:
I will add tests as soon as I find the time. |
FWIW I'm finding the ep_comments tests pretty damn unreliable. I'm trying to narrow it down and get them stable now. |
bumping @rhansen |
Heads up: I just rebased your branch and force-pushed. |
Looks good, thank you! Would you mind updating the There are some pre-existing issues (not the fault of this PR) that should be addressed in separate PRs:
|
I had a thought: Rather than call |
I pushed a commit to your branch that moves the |
86dae71
to
ed5e163
Compare
I was curious about how Etherpad core handles read-write vs. read-only users for normal edit messages, and it looks like it puts both types of users in the same socket.io "room". I think we should do that here for consistency. I'll push another commit. |
199b9f6
to
cac03f4
Compare
Done, and I rebased onto latest |
This reduces the complexity of commentManager. It also makes future authorization checks easier to implement (because the checks should be performed where the messages arrive, not deep in the abstracted internals). Also: Update the `apiAddComments` and `apiAddCommentReplies` message events to broadcast to both pad IDs.
This is what Etherpad core does.
I went ahead and merged this. Thanks for the fix @pr4xx! |
I think this sould resolve issues related to pads using regular as well as read only pad ids.
This commit basically updates each broadcast to include both ids. For that, the
commentManager
functions return both padIds in their callbacks.