-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Load-sdk-once #12764
base: main
Are you sure you want to change the base?
Load-sdk-once #12764
Conversation
@Hinton one of the things that gives me pause about adding this to init services is that you'd seen long wasm load times in some of our userbase. However, I saw you recently removed the logging there. Is everything good to go? Hopefully no more concerns about loading that module? |
New Issues (8)Checkmarx found the following issues in this Pull Request
Fixed Issues (1)Great job! The following issues were fixed in this Pull Request
|
@MGibson1 We still saw some long loads but our theory is the machine is busy doing other things and haven't gotten back to continuing the wasm load. There are logging statements in place to assist in tracking this down should we receive reports from users. This seems like it's replacing the factories with loaders, can we remove the factories, the initialization step should be identical across environment with these changes? |
Note: If the main process ever requires an SDK, we'll need to load it there, too. In that event, it's probably a good idea to move to IPC for all SDK functions to avoid loading the SDK for every window.
I wasn't sure about this since the web is calling a global function that for some reason was ensuring the module was inited again. These changes have now been pushed here. |
A CLI sdk load service that async imports our wasm binary doesn't seem to be needed to run, but jest isn't dealing with the ESM import properly.
Codecov ReportAttention: Patch coverage is
✅ All tests successful. No failed tests found. Additional details and impacted files@@ Coverage Diff @@
## main #12764 +/- ##
==========================================
+ Coverage 34.14% 34.27% +0.13%
==========================================
Files 2937 2937
Lines 90337 90108 -229
Branches 16961 16921 -40
==========================================
+ Hits 30846 30886 +40
+ Misses 57036 56763 -273
- Partials 2455 2459 +4 ☔ View full report in Codecov by Sentry. |
📔 Objective
Current SDK loading occurs only when an sdk client is requested. However, ssh key generation uses a pure function to generate ED25519 keys which does not require a client. As dependency on the SDK increases, it is more appropriate to ensure the WASM module is loaded as a part of initialization than repeatedly when creating a client.
📸 Screenshots
The effect of slow wasm loading is to keep the page on the un-inited spinner state for longer:
web
Screen.Recording.2025-01-09.at.9.22.57.AM.mov
browser
Screen.Recording.2025-01-09.at.9.35.07.AM.mov
cli
Screen.Recording.2025-01-09.at.9.38.08.AM.mov
desktop
Screen.Recording.2025-01-09.at.9.57.37.AM.mov
⏰ Reminders before review
🦮 Reviewer guidelines
:+1:
) or similar for great changes:memo:
) or ℹ️ (:information_source:
) for notes or general info:question:
) for questions:thinking:
) or 💭 (:thought_balloon:
) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion:art:
) for suggestions / improvements:x:
) or:warning:
) for more significant problems or concerns needing attention:seedling:
) or ♻️ (:recycle:
) for future improvements or indications of technical debt:pick:
) for minor or nitpick changes