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

WIP: refactor(backend): Socket state management refactor + adding redis adapter #574

Merged
merged 2 commits into from
May 15, 2024

Conversation

LunarFang416
Copy link
Contributor

@LunarFang416 LunarFang416 commented Mar 28, 2024

Details

  • This PR attempts to fix the socket management issues we are currently facing
  • There were a few errors in the code regarding how we were managing rooms and users, which I fixed
  • Did thorough testing for a lot of different flows to make sure events are propogated
  • Also added a redis-adapter to the socket server so that when we are running servers on scale, different users connected to the same room but on different servers will also receive events

Closes #{ISSUE-NUMBER}

@LunarFang416 LunarFang416 marked this pull request as ready for review April 7, 2024 20:09
Copy link
Contributor

@JoelWiebe JoelWiebe left a comment

Choose a reason for hiding this comment

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

Great idea using the redis adapter. Hopefully once we figure out these couple items this will provide us with some much needed stability and reliability.

Tested:

  1. Canvas: Create and tag posts on a canvas with two concurrent users
  2. Workflow: Generate 2 posts in canvas (Bug)
  3. Workflow: Generate 3 posts in bucket
  4. Workflow: Move ideas between buckets
  5. Workflow: Peer review ideas to move between buckets
  6. Workflow: Peer review ideas from canvas to bucket (Bug)
  7. Workflow: Generate 4 posts to canvas (Bug)

Bugs (may not be related to web sockets):
2.

  • (a) When creating posts in the Workspace, posts created with tags are not displayed on the canvas.
  • (b) If the final post created has a tag then the task fails to be marked as complete.
  • (c) Posts are only displayed in the canvas after the canvas is refreshed--should they be showing up immediately?
  • In the Workspace, when peer reviewing posts from the canvas to a bucket, all posts across the project were displayed as posts to review (including all posts from buckets and the two posts that did not appear on the canvas from the task above). Conclusion: This workflow is mistakenly providing all posts for peer review rather than only posts on the canvas.
  • In the Workspace, I created all four posts with no tag. Upon completion they were all added to the canvas, but posts 1, 2, and 3 were posted twice and the 4th only once. NOTE: Could not replicate this.

Screenshot 2024-04-10 at 10 25 55 PM

  • Additionally, I'm noticing only canvas events are being logged. No posts tagged or created in the Workspace are being logged. Is this unrelated to web sockets?

this._io = io;

console.log('Socket server running at ' + 8000);

io.on('connection', (socket) => {
this._socket = socket;
// this._socket = socket;
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we remove this line?

@JoelWiebe
Copy link
Contributor

JoelWiebe commented Apr 25, 2024

I just noticed another item:

  • Bucket view (with posts) produces the following error: "ERROR TypeError: Cannot read properties of undefined (reading 'projectID')" -- board.service.ts:12

@LunarFang416
Copy link
Contributor Author

Will create new issues for the existing bugs, merging this in for now.

@LunarFang416 LunarFang416 merged commit ecedf9a into develop May 15, 2024
2 checks passed
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