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

Load-sdk-once #12764

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Load-sdk-once #12764

wants to merge 5 commits into from

Conversation

MGibson1
Copy link
Member

@MGibson1 MGibson1 commented Jan 8, 2025

📔 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

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Protected functional changes with optionality (feature flags)
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team

🦮 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

@MGibson1 MGibson1 requested a review from a team as a code owner January 8, 2025 22:18
@MGibson1 MGibson1 requested review from coroiu and Hinton January 8, 2025 22:18
@MGibson1
Copy link
Member Author

MGibson1 commented Jan 8, 2025

@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?

Copy link
Contributor

github-actions bot commented Jan 8, 2025

Logo
Checkmarx One – Scan Summary & Detailsd8bb6f9c-d49e-43c9-81d3-0ba212b88f8e

No New Or Fixed Issues Found

@Hinton
Copy link
Member

Hinton commented Jan 9, 2025

@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.
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.

2 participants