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

Scene dragging: do not save new scene comment canvas position in every frame #4872

Merged
merged 1 commit into from
Feb 12, 2024

Conversation

gbalint
Copy link
Contributor

@gbalint gbalint commented Feb 12, 2024

Problem:
CommentMaintainer saves the new global position of scene comments when there is a position change, even during interactions. Updating liveblocks like this is waaay too frequent, and causes bugs and test failures.

Fix:
Do not do anything during canvas interactions. The new position is stored right after the interaction is over.

Copy link
Contributor

github-actions bot commented Feb 12, 2024

Try me

Copy link

relativeci bot commented Feb 12, 2024

Job #10373: Bundle Size — 61.73MiB (~+0.01%).

47807c6(current) vs d299c8d master#10372(baseline)

Warning

Bundle contains 57 duplicate packages – View duplicate packages

Bundle metrics  Change 2 changes Regression 1 regression
                 Current
Job #10373
     Baseline
Job #10372
Regression  Initial JS 34.77MiB(~+0.01%) 34.77MiB
No change  Initial CSS 0B 0B
Change  Cache Invalidation 20.46% 85.16%
No change  Chunks 28 28
No change  Assets 32 32
No change  Modules 4294 4294
No change  Duplicate Modules 493 493
No change  Duplicate Code 31.01% 31.01%
No change  Packages 455 455
No change  Duplicate Packages 57 57
Bundle size by type  Change 2 changes Regression 1 regression Improvement 1 improvement
                 Current
Job #10373
     Baseline
Job #10372
Regression  JS 61.72MiB (~+0.01%) 61.72MiB
Improvement  HTML 11.37KiB (-0.32%) 11.41KiB

View job #10373 reportView fix/scene-comment-maintanence branch activityView project dashboard

Copy link
Contributor

Performance test results:
(Chart1)
(Chart2)

if (isInteraction) {
return
}

threads.forEach(async (t): Promise<void> => {
Copy link
Contributor

Choose a reason for hiding this comment

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

mhmmmmmm, are we directly calling editThreadMetadata from render? shouldn't this part be wrapped in a useEffect?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This triggers an async liveblocks update but does not wait for it, so it did not seem dangerous to me.

@gbalint gbalint merged commit c112500 into master Feb 12, 2024
22 checks passed
@gbalint gbalint deleted the fix/scene-comment-maintanence branch February 12, 2024 14:35
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.

5 participants