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

Collaborators from the DB #4946

Merged
merged 23 commits into from
Feb 26, 2024
Merged

Collaborators from the DB #4946

merged 23 commits into from
Feb 26, 2024

Conversation

ruggi
Copy link
Contributor

@ruggi ruggi commented Feb 22, 2024

Fix #4944

This is a followup to #4923, that turns the Utopia DB into the source of truth for collaborators, dropping them from the storage entirely.

  1. When the user opens a project, the editor will load the collaborators while contextually adding the user to the project collaborators, if missing.
  2. When the editor loads, the collaborators are loaded and a listener on the room is added so that the state collaborators are refreshed when needed.
  3. If the editor is not using the BFF, for backwards compatibility the collaborators are loaded from the LB client. ⚠️ This is only temporary to allow for smooth sailing in .app while we don't enable the BFF there too.

The collaborators field in the LB object is kept just as a compatibility measure until we enable the BFF in production. A consequent PR should drop entirely that field and the other related things marked as _DEPRECATED.

Copy link
Contributor

github-actions bot commented Feb 22, 2024

Try me

Copy link

relativeci bot commented Feb 22, 2024

Job #10589: Bundle Size — 62.25MiB (+0.02%).

998b6d7(current) vs f583697 master#10569(baseline)

Warning

Bundle contains 58 duplicate packages – View duplicate packages

Bundle metrics  Change 4 changes Regression 2 regressions
                 Current
Job #10589
     Baseline
Job #10569
Regression  Initial JS 35.27MiB(+0.03%) 35.26MiB
No change  Initial CSS 0B 0B
Change  Cache Invalidation 22.16% 20.47%
No change  Chunks 28 28
No change  Assets 32 32
Change  Modules 4363(+0.05%) 4361
Regression  Duplicate Modules 496(+0.2%) 495
No change  Duplicate Code 30.84% 30.84%
No change  Packages 467 467
No change  Duplicate Packages 58 58
Bundle size by type  Change 2 changes Regression 1 regression Improvement 1 improvement
                 Current
Job #10589
     Baseline
Job #10569
Regression  JS 62.24MiB (+0.02%) 62.23MiB
Improvement  HTML 11.37KiB (-0.32%) 11.41KiB

View job #10589 reportView feat/remix-collaborators-db branch activityView project dashboard

Copy link
Contributor

github-actions bot commented Feb 22, 2024

Performance test results:
(Chart1)
(Chart2)

Copy link
Contributor

Performance test results:

1 similar comment
Copy link
Contributor

Performance test results:

@ruggi ruggi marked this pull request as ready for review February 23, 2024 14:11
}

export function useCollaborators() {
return useStorage((store) => store.collaborators)
return useEditorState(
Substores.restOfEditor,
Copy link
Contributor

Choose a reason for hiding this comment

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

I suggest to add a new Substore for multiplayer related stuff.
Or maybe use an atom for collaborators instead of the editor state (it seems to be quite independent from other parts of the state)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@gbalint I added a multiplayer substate here fbb22ca (#4946) . would that work for you or would you prefer the atom instead?

@ruggi ruggi force-pushed the feat/remix-collaborators-db branch from 8f72976 to fbb22ca Compare February 23, 2024 15:15
Copy link
Contributor

Performance test results:

@ruggi ruggi merged commit 7adcafa into master Feb 26, 2024
14 of 15 checks passed
@ruggi ruggi deleted the feat/remix-collaborators-db branch February 26, 2024 16:03
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.

BFF collaborators in the DB
4 participants