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

Implement websockets #4797

Open
FelixMalfait opened this issue Apr 4, 2024 · 5 comments
Open

Implement websockets #4797

FelixMalfait opened this issue Apr 4, 2024 · 5 comments
Assignees
Labels
for experienced contributor scope: back+front Issues requiring full-stack knowledge

Comments

@FelixMalfait
Copy link
Member

This is the first step towards a really cool feature: real-time sync.
The goal is to have a real-time multi-players experience soon.
Building a first version shouldn't be too complex as the project is already built upon strong foundations (Apollo on frontend, events already implemented on the backend, etc.)

We will break down this work into multiple issues to review PRs step by step

Here are the steps for this first issue to do a proof of concept.
Steps:

Note: I was initially in favor of implementing SSE instead of WS but changed my mind again.
Because we might have a use-case for bi-directionnal communication as some point (possible it seems), for exemple moving the track() analytics endpoint called by frontend on every pageview (in the future we'll be displaying who's viewing the same page "live" and their status, like on Google Docs)

@i-am-chitti
Copy link
Contributor

@FelixMalfait SSE are great for unidirectional communication. But making it bidirectional has its own benefit. As this application is gonna be enterprise grade tackling numerous use-cases, I think decision to go with WS is gonna be scalable.

The issue looks cool and complex at same time. I would love to work on this from the very start. Wish me good luck, I'm starting on this. Will be reaching out to you in case of queries.

@FelixMalfait
Copy link
Member Author

@i-am-chitti great! fyi I changed the structure of the Events object a bit and renamed it to AuditLog in this PR which hasn't been merged yet: #4936

I also think it's a cool and interesting issue, never implemented WS myself and curious to see how it plays out!
Next step after console.log will be to inject the events we receive to update the apollo cache

@FelixMalfait
Copy link
Member Author

Feel free to DM me on Discord if you need help @i-am-chitti

@i-am-chitti
Copy link
Contributor

@FelixMalfait, What do you mean by this?

Console.log the received events in DB

Like on getting event streams from Websockets on frontend, I should only do a console.log, right? Then, what's the DB referred to here?

@FelixMalfait
Copy link
Member Author

@i-am-chitti I meant that as a first step we could just console.log the events received from the backend and not to the work of injecting them in the apollo cache (that can be in another issue/pr)

The events that are sent to the frontend are also logged in the database (in the "AuditLog" table in my new PR, in Events table currently)

@FelixMalfait FelixMalfait unpinned this issue Apr 18, 2024
i-am-chitti added a commit to i-am-chitti/twenty that referenced this issue Apr 23, 2024
i-am-chitti added a commit to i-am-chitti/twenty that referenced this issue Apr 23, 2024
i-am-chitti added a commit to i-am-chitti/twenty that referenced this issue Apr 23, 2024
i-am-chitti added a commit to i-am-chitti/twenty that referenced this issue Apr 23, 2024
i-am-chitti added a commit to i-am-chitti/twenty that referenced this issue May 1, 2024
i-am-chitti added a commit to i-am-chitti/twenty that referenced this issue May 1, 2024
i-am-chitti added a commit to i-am-chitti/twenty that referenced this issue May 4, 2024
i-am-chitti added a commit to i-am-chitti/twenty that referenced this issue May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
for experienced contributor scope: back+front Issues requiring full-stack knowledge
Projects
Status: 🆕 New
Development

No branches or pull requests

2 participants