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

improvement: Split the messaging channel between user and moderator/owner #4113

Closed
wants to merge 16 commits into from

Conversation

mateo-ivc
Copy link
Collaborator

@mateo-ivc mateo-ivc commented Apr 30, 2024

Description

Splitted up the board subscription into two channels. Prior every user subscribed to boards.<boardID> now based on the role each user connects to boards.<boardID>.participant or boards.<boardID>.moderator.
Why? To avoid sending events to participants they don't have access to.

Changelog

api/boards_listen_on_board.go

  • clients and subscriptions are now stored in a map based on their roles
  • running each channel in it's own goroutine
  • added method to change channels when participants role gets updated.
  • added mutex to BoardSubscription struct to avoid concurrent access on the websockets.

event_filter.go

  • change the method signature to b *Boardsubscription to be uniform
  • added if clause for realtime.BoardEventParticipantUpdated to cache updated user

board_sessions_observer.go

  • columns and notes included in the parameters of UpdateSession -> must be passed on in order to be able to send Column_Update and Notes_Sync events.
  • added db calls to get notes and columns from board

database/columns.go

  • storing the column to be deleted in context to check later if this column_delete event should be send to all participant or only mods/owner

database/columns_observer.go

  • added the column to be deleted to the params of DeleteColumn to later check if this column is hidden or not

database/notes.go

  • storing the note to be deleted in the context to later check if this note is in a hidden column or not

database/notes_observer.go

  • added note and columns as parameters to DeletedNote call

realtime/boards.go

  • Added SessionChannel type for the two channels
  • Edited BroadcastToBoard() to be able to broadcast to multiple channels
  • BroadcastToBoard() and GetBoardChannel() now now subscribe/listen to boards.<boardID>.moderator/participant

services/...

  • Fixed all services by adding channels when calling realtime.BroadcastToBoard
  • in some cases the event should only be sent to the moderators -> DeletedColumns, DeletedNote
    in order to send the event to the correct channel, it's necessary to check if the column is hidden or not.

services/boards/sessions.go

  • UpdatedSession -> added two more broadcasts that are needed when a participants role gets updated to display hidden columns and their notes.

Checklist

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • The light- and dark-theme are both supported and tested
  • The design was implemented and is responsive for all devices and screen sizes
  • The application was tested in the most commonly used browsers (e.g. Chrome, Firefox, Safari)

(Optional) Visual Changes

@mateo-ivc mateo-ivc self-assigned this Apr 30, 2024
Copy link

octomind-dev bot commented May 2, 2024

🐙 Octomind

Test Report: 0/14 successful.

description status details
About Section Visibility Test Failed ❌ click
change avatar Failed ❌ click
check Privacy Policy Failed ❌ click
check terms & conditions Failed ❌ click
close cookie banner - front page Failed ❌ click
close cookie banner - sign-in Failed ❌ click
create and delete board columns Failed ❌ click
create_and_delete_notes_and_actions_v2 Failed ❌ click
create lean coffee board Failed ❌ click
edit_notes_and_actions_v5 Failed ❌ click
get started Failed ❌ click
share_session Failed ❌ click
sign-in Failed ❌ click
test all ways to open the setup flow Failed ❌ click

commit sha: f7733ad

Copy link

octomind-dev bot commented May 2, 2024

🐙 Octomind

Test Report: 0/14 successful.

description status details
About Section Visibility Test Failed ❌ click
change avatar Failed ❌ click
check Privacy Policy Failed ❌ click
check terms & conditions Failed ❌ click
close cookie banner - front page Failed ❌ click
close cookie banner - sign-in Failed ❌ click
create and delete board columns Failed ❌ click
create_and_delete_notes_and_actions_v2 Failed ❌ click
create lean coffee board Failed ❌ click
edit_notes_and_actions_v5 Failed ❌ click
get started Failed ❌ click
share_session Failed ❌ click
sign-in Failed ❌ click
test all ways to open the setup flow Failed ❌ click

commit sha: f7733ad

Copy link

octomind-dev bot commented May 2, 2024

🐙 Octomind

Test Report: 6/14 successful.

description status details
About Section Visibility Test Passed ✅ click
change avatar Failed ❌ click
check Privacy Policy Passed ✅ click
check terms & conditions Passed ✅ click
close cookie banner - front page Passed ✅ click
close cookie banner - sign-in Passed ✅ click
create and delete board columns Failed ❌ click
create_and_delete_notes_and_actions_v2 Failed ❌ click
create lean coffee board Failed ❌ click
edit_notes_and_actions_v5 Failed ❌ click
get started Passed ✅ click
share_session Failed ❌ click
sign-in Failed ❌ click
test all ways to open the setup flow Failed ❌ click

commit sha: f7733ad

Copy link

octomind-dev bot commented May 2, 2024

🐙 Octomind

Test Report: 6/14 successful.

description status details
About Section Visibility Test Passed ✅ click
change avatar Failed ❌ click
check Privacy Policy Passed ✅ click
check terms & conditions Passed ✅ click
close cookie banner - front page Passed ✅ click
close cookie banner - sign-in Passed ✅ click
create and delete board columns Failed ❌ click
create_and_delete_notes_and_actions_v2 Failed ❌ click
create lean coffee board Failed ❌ click
edit_notes_and_actions_v5 Failed ❌ click
get started Passed ✅ click
share_session Failed ❌ click
sign-in Failed ❌ click
test all ways to open the setup flow Failed ❌ click

commit sha: f7733ad

Copy link

octomind-dev bot commented May 2, 2024

🐙 Octomind

Test Report: 6/14 successful.

description status details
About Section Visibility Test Passed ✅ click
change avatar Failed ❌ click
check Privacy Policy Passed ✅ click
check terms & conditions Passed ✅ click
close cookie banner - front page Passed ✅ click
close cookie banner - sign-in Passed ✅ click
create and delete board columns Failed ❌ click
create_and_delete_notes_and_actions_v2 Failed ❌ click
create lean coffee board Failed ❌ click
edit_notes_and_actions_v5 Failed ❌ click
get started Passed ✅ click
share_session Failed ❌ click
sign-in Failed ❌ click
test all ways to open the setup flow Failed ❌ click

commit sha: aeedb3d

Copy link

octomind-dev bot commented May 2, 2024

🐙 Octomind

Test Report: 6/14 successful.

description status details
About Section Visibility Test Passed ✅ click
change avatar Failed ❌ click
check Privacy Policy Passed ✅ click
check terms & conditions Passed ✅ click
close cookie banner - front page Passed ✅ click
close cookie banner - sign-in Passed ✅ click
create and delete board columns Failed ❌ click
create_and_delete_notes_and_actions_v2 Failed ❌ click
create lean coffee board Failed ❌ click
edit_notes_and_actions_v5 Failed ❌ click
get started Passed ✅ click
share_session Failed ❌ click
sign-in Failed ❌ click
test all ways to open the setup flow Failed ❌ click

commit sha: afaf300

Copy link

octomind-dev bot commented May 3, 2024

🐙 Octomind

Test Report: 6/14 successful.

description status details
About Section Visibility Test Passed ✅ click
change avatar Failed ❌ click
check Privacy Policy Passed ✅ click
check terms & conditions Passed ✅ click
close cookie banner - front page Passed ✅ click
close cookie banner - sign-in Passed ✅ click
create and delete board columns Failed ❌ click
create_and_delete_notes_and_actions_v2 Failed ❌ click
create lean coffee board Failed ❌ click
edit_notes_and_actions_v5 Failed ❌ click
get started Passed ✅ click
share_session Failed ❌ click
sign-in Failed ❌ click
test all ways to open the setup flow Failed ❌ click

commit sha: 812fe4a

@brandstetterm
Copy link
Collaborator

Splitted up the board subscription into two channels. Prior every user subscribed to boards.<boardID> now based on the role each user connects to boards.<boardID>.participant or boards.<boardID>.moderator.
Why? To avoid sending events to participants they don't have access to.

I think I've noted it before, but I think it would be better if every user continued to have boards.<boardID> subscribed. Moderators additionally have boards.<boardID>.moderator subscribed. This prevents us from sending more or less the same information in two different channels.

server/src/api/event_filter.go Outdated Show resolved Hide resolved
server/src/api/boards_listen_on_board.go Outdated Show resolved Hide resolved
@mateo-ivc
Copy link
Collaborator Author

Splitted up the board subscription into two channels. Prior every user subscribed to boards.<boardID> now based on the role each user connects to boards.<boardID>.participant or boards.<boardID>.moderator.
Why? To avoid sending events to participants they don't have access to.

I think I've noted it before, but I think it would be better if every user continued to have boards.<boardID> subscribed. Moderators additionally have boards.<boardID>.moderator subscribed. This prevents us from sending more or less the same information in two different channels.

If we were to have the moderators subscribe to a second channel just for moderator information, we would have to write a new filter that removes the public data, or we would be sending the same information twice.
So I thought it would be a better approach to use the already existing event_filter and just split the channels.
Issue #3413 also suggests splitting the channel, if I understand correctly

@brandstetterm
Copy link
Collaborator

Splitted up the board subscription into two channels. Prior every user subscribed to boards.<boardID> now based on the role each user connects to boards.<boardID>.participant or boards.<boardID>.moderator.
Why? To avoid sending events to participants they don't have access to.

I think I've noted it before, but I think it would be better if every user continued to have boards.<boardID> subscribed. Moderators additionally have boards.<boardID>.moderator subscribed. This prevents us from sending more or less the same information in two different channels.

If we were to have the moderators subscribe to a second channel just for moderator information, we would have to write a new filter that removes the public data, or we would be sending the same information twice. So I thought it would be a better approach to use the already existing event_filter and just split the channels. Issue #3413 also suggests splitting the channel, if I understand correctly

Yeah, but the intention of the issue has been that the new moderator channel will be exclusively used for the information that normal participants shouldn't see afaik

Copy link

octomind-dev bot commented May 6, 2024

🐙 Octomind

Test Report: 6/14 successful.

description status details
About Section Visibility Test Passed ✅ click
change avatar Failed ❌ click
check Privacy Policy Passed ✅ click
check terms & conditions Passed ✅ click
close cookie banner - front page Passed ✅ click
close cookie banner - sign-in Passed ✅ click
create and delete board columns Failed ❌ click
create_and_delete_notes_and_actions_v2 Failed ❌ click
create lean coffee board Failed ❌ click
edit_notes_and_actions_v5 Failed ❌ click
get started Passed ✅ click
share_session Failed ❌ click
sign-in Failed ❌ click
test all ways to open the setup flow Failed ❌ click

commit sha: 4a7b959

Copy link

github-actions bot commented May 6, 2024

The deployment to the dev cluster was successful. You can find the deployment here: https://4113.development.scrumlr.fra.ics.inovex.io
This deployment is only for testing purposes and will be deleted after 1 week.
To redeploy rerun the workflow.
DO NOT STORE IMPORTANT DATA ON THIS DEPLOYMENT

Deployed Images
  • ghcr.io/inovex/scrumlr.io/scrumlr-frontend:sha-4a7b959

  • ghcr.io/inovex/scrumlr.io/scrumlr-server:sha-4a7b959

Copy link

octomind-dev bot commented May 6, 2024

🐙 Octomind

Test Report: 13/14 successful.

description status details
About Section Visibility Test Passed ✅ click
change avatar Passed ✅ click
check Privacy Policy Passed ✅ click
check terms & conditions Passed ✅ click
close cookie banner - front page Passed ✅ click
close cookie banner - sign-in Passed ✅ click
create and delete board columns Passed ✅ click
create_and_delete_notes_and_actions_v2 Passed ✅ click
create lean coffee board Failed ❌ click
edit_notes_and_actions_v5 Passed ✅ click
get started Passed ✅ click
share_session Passed ✅ click
sign-in Passed ✅ click
test all ways to open the setup flow Passed ✅ click

commit sha: 4a7b959

@mateo-ivc mateo-ivc added the Review Needed This pull request is ready for review label May 7, 2024
@mateo-ivc mateo-ivc removed the Review Needed This pull request is ready for review label Jun 18, 2024
@mateo-ivc mateo-ivc closed this Jul 23, 2024
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.

None yet

2 participants