Skip to content

Repeated Registering of Listener #912

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

Closed
wants to merge 1 commit into from
Closed

Repeated Registering of Listener #912

wants to merge 1 commit into from

Conversation

mookums
Copy link
Contributor

@mookums mookums commented Jul 23, 2025

This allows for repeated registering of a listener. This fixes old.reddit.com and allow for both the body and the comments to be properly fetched.

// remove any existing listener, so it should be impossible to get null
// from this function call.
const eh = (try EventHandler.register(alloc, target, typ, listener, null)) orelse unreachable;
const eh = (try EventHandler.register(alloc, target, typ, listener, null)) orelse return null;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we understand how this is happening? I tend to agree with the comment. This is only called from a set_xyz and all the set_xyz should unregister the existing callback, so how is EventHandler.register returning null?

@mookums mookums closed this Jul 23, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Jul 23, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants