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

JELP SJOINs have a single perspective, causing modes to be lost during burst #100

Closed
cooper opened this issue Jul 13, 2016 · 4 comments
Closed

Comments

@cooper
Copy link
Owner

cooper commented Jul 13, 2016

Problem

Consider a scenario with three servers: A, B, and C. Servers A and C are both directly connected to server B, so A and C reach each other only through B. Suppose that servers A and B are already linked and server C is just now connecting to server B.

If servers A and C have five status modes and server B only has two, something weird occurs:

  • On burst, only users with the two modes recognized by server B will have the proper statuses on server C. Even though server C has five prefixes, the burst occurs in the perspective of server B which only has two.
  • On other mode changes (CMODE), the modes are in the perspective of the origin server. If a CMODE message is received from server A and it involves modes unknown to server B, server C will still accept them.

I used status modes in this example, but this actually applies to all channel modes.

Solution??

One solution would be to send individual SJOINs on burst, one for each server with users on the channel. Each SJOIN would have the mode string in the perspective of the source server, so not all of them will necessarily be the same.

@cooper
Copy link
Owner Author

cooper commented Jul 14, 2016

If one SJOIN per server is the way to go, then we would have to send an SJOIN per server even if that server has no users on the channel. That can't work. Too floody.

New idea: Queue the first SJOIN from the current server like we do currently with all the modes and users known to this server.

Then go through each other server with users on the channel. If they have status modes that were not in the first message, the users will occur in this new SJOIN in the perspective of this other server which knows the modes. And remove the users from the first message, which was queued.

At this point, the status modes should be consistent, but other modes might not be. This would occur if modes are set on certain servers with no users in the channel. Wait, is that even possible? Probably not unless it was permanent. We could compare the other mode strings with ->cmode_string_difference(), but that seems crazy.

@cooper
Copy link
Owner Author

cooper commented Jul 14, 2016

SJOIN handler is being rewritten, and the new one will handle this properly, but first have to add new methods for mode operations. See #77.

@cooper
Copy link
Owner Author

cooper commented Jul 14, 2016

#70 is also related and will be fixed with the new SJOIN handler

@cooper
Copy link
Owner Author

cooper commented Jul 19, 2016

Unfortunately it's impossible to send SJOINs with mode information that is not known to the bursting server. This is because parameters are handled by modules and servers cannot track unknown modes.

So for now it will continue to work like this:

  • On burst, modes unknown to the server are not sent to the new uplink.
  • Other mode changes involving unknown modes which occur in real-time WILL be forwarded and handled appropriately.

The above will work fine as long as modules providing channel modes are consistent across the network. Actually servers A and C linked through server B will remain in sync as long as server B knows the mode in question. Other insane situations might eventually be fixed by the MODESYNC mechanism (#63).

@cooper cooper closed this as completed Jul 19, 2016
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