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

fix(electron): remove all migration code in electron #6969

Conversation

pengx17
Copy link
Collaborator

@pengx17 pengx17 commented May 16, 2024

The migration code import blocksuite in the dependency tree and prevent affine from running because electron's helper process tries to run browser only code that is part of the side effect of @blocksuite/blocks.

image.png

The side effect free trick in esbuild config does not clean up these - not sure why.

It has been already 6 month since we introduced the migration code in DB.
Instead of finding out the real root cause, I think may be better to remove the migration code completely so that no blocksuite code will be in the import paths in helper.js.

image.png

Copy link

graphite-app bot commented May 16, 2024

Your org has enabled the Graphite merge queue for merging into canary

Add the label “merge” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “hotfix” to add to the merge queue as a hot fix.

You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link.

@github-actions github-actions bot added mod:infra Environment related issues and discussions app:electron Related to electron app labels May 16, 2024
Copy link
Collaborator Author

pengx17 commented May 16, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @pengx17 and the rest of your teammates on Graphite Graphite

@pengx17 pengx17 marked this pull request as ready for review May 16, 2024 16:59
@pengx17 pengx17 requested review from Brooooooklyn and EYHN May 16, 2024 16:59
Copy link

codecov bot commented May 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 67.40%. Comparing base (10015c5) to head (bd5023d).

Additional details and impacted files
@@            Coverage Diff             @@
##           canary    #6969      +/-   ##
==========================================
- Coverage   67.41%   67.40%   -0.02%     
==========================================
  Files         583      582       -1     
  Lines       28079    28012      -67     
  Branches     2582     2574       -8     
==========================================
- Hits        18929    18881      -48     
+ Misses       8879     8860      -19     
  Partials      271      271              
Flag Coverage Δ
server-test 78.09% <ø> (-0.01%) ⬇️
unittest 39.74% <ø> (-0.17%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

darkskygit

This comment was marked as duplicate.

@darkskygit darkskygit self-requested a review May 16, 2024 17:38
Copy link
Member

@darkskygit darkskygit left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link

graphite-app bot commented May 17, 2024

Merge activity

  • May 16, 11:00 PM EDT: Brooooooklyn added this pull request to the Graphite merge queue.
  • May 16, 11:18 PM EDT: The Graphite merge queue couldn't merge this PR because it was not satisfying all requirements (Failed CI: '3, 2, 1 Launch', 'Server E2E Test 1/3').
  • May 16, 11:29 PM EDT: Brooooooklyn added this pull request to the Graphite merge queue.
  • May 16, 11:29 PM EDT: Brooooooklyn merged this pull request with the Graphite merge queue.

The migration code import blocksuite in the dependency tree and prevent affine from running because electron's helper process tries to run browser only code that is part of the side effect of `@blocksuite/blocks`.

![image.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/T2klNLEk0wxLh4NRDzhk/53da3972-7433-4631-b8c2-d3e322066c7d.png)

[The side effect free trick in esbuild config](#6415)  does not clean up these - not sure why.

It has been already 6 month since we introduced the migration code in DB.
Instead of finding out the real root cause, I think may be better to remove the migration code completely so that no blocksuite code will be in the import paths in helper.js.

![image.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/T2klNLEk0wxLh4NRDzhk/3b03522a-2a25-4bdb-8287-86a6b94623e1.png)
@Brooooooklyn Brooooooklyn force-pushed the xp/05-17-fix_electron_remove_all_migration_code_in_electron branch from a720079 to bd5023d Compare May 17, 2024 03:01
@graphite-app graphite-app bot merged commit bd5023d into canary May 17, 2024
32 checks passed
@graphite-app graphite-app bot deleted the xp/05-17-fix_electron_remove_all_migration_code_in_electron branch May 17, 2024 03:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
app:electron Related to electron app mod:infra Environment related issues and discussions
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

None yet

3 participants