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

Add autojoin and show join leave events #587

Merged
merged 31 commits into from
Aug 5, 2024

Conversation

clemire
Copy link
Contributor

@clemire clemire commented Jul 30, 2024

space payload snapshot channel metadata includes new ChannelSettings message with fields for

  • autojoin
  • hide user join and leave events

These can be optionally included in the Channel Inception message, if not all fields are false by default.
Two new messages on Space Payload to manually toggle these two settings, as well as client endpoints.

migration sets autojoin as true for default channels (22 trailing 0s), but from this PR on all channels will be not autojoin unless explicitly toggled on. snapshot migrations apply these defaults.

e2e tests validate:

  • settings properly set on channel inception
  • client events emitted on changes to both settings
  • client space streamview state updates appropriately in response to inception and update messages
  • only permitted users can update these properties

@clemire clemire marked this pull request as ready for review August 1, 2024 01:09
@texuf texuf requested a review from miguel-nascimento August 1, 2024 16:55
core/node/events/snapshot.go Outdated Show resolved Hide resolved
core/node/events/snapshot.go Outdated Show resolved Hide resolved
protocol/protocol.proto Outdated Show resolved Hide resolved
@clemire clemire requested a review from texuf August 1, 2024 22:29
core/node/shared/ids.go Outdated Show resolved Hide resolved
Copy link
Contributor

@texuf texuf left a comment

Choose a reason for hiding this comment

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

It looks great. Can you fix the merge and compile errors?

@clemire clemire requested a review from texuf August 2, 2024 21:08
@@ -484,13 +484,14 @@ func (ru *csChannelRules) derivedChannelSpaceParentEvent() (*DerivedEvent, error
}

payload := events.Make_SpacePayload_ChannelUpdate(
Copy link
Contributor

Choose a reason for hiding this comment

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

it looks like Evan might not get to this work this week, it's not his highest priority, so we need to make sure it's backwards compatable with old clients by checking for a nil ChannelSettings here, and if ChannelSettings is nil, adding an autoJoin=true if the channelId is a default channel id?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

whoa good catch

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well actually, I think the snapshot will render the channel setting as autojoin=true when the channelupdate is emitted with empty channel settings for the default channel... but if you'd prefer this change, no problem.

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh wow - yeah looks like that would happen - can we make this change anyway in case that code changes or we start looking at the snapshot in a different way in the future?

Copy link
Contributor

Choose a reason for hiding this comment

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

actually never mind, lets leave this how it is

Copy link
Contributor Author

@clemire clemire Aug 3, 2024

Choose a reason for hiding this comment

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

Oh I went ahead and made the change, but I left the old code there too

@clemire clemire requested a review from texuf August 2, 2024 23:07
@clemire clemire merged commit 1730085 into main Aug 5, 2024
8 checks passed
@clemire clemire deleted the crystal/674-protocol-autojoin-channels branch August 5, 2024 20:34
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.

2 participants