-
Notifications
You must be signed in to change notification settings - Fork 44
fix(sdk): wasm sdk is not initialized for static methods #2788
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(sdk): wasm sdk is not initialized for static methods #2788
Conversation
WalkthroughThe EvoSDK static methods setLogLevel and getLatestVersionNumber were converted to async, each awaiting initWasm() before delegating to the wasm SDK. Their return types changed to Promise and Promise, ensuring Wasm initialization precedes calls. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant C as Caller
participant E as EvoSDK
participant W as initWasm()
participant S as Wasm SDK
rect rgb(235, 245, 255)
note over E: setLogLevel (async)
C->>E: setLogLevel(levelOrFilter)
E->>W: await initWasm()
W-->>E: initialized
E->>S: setLogLevel(levelOrFilter)
S-->>E: void
E-->>C: Promise<void> resolved
end
sequenceDiagram
autonumber
participant C as Caller
participant E as EvoSDK
participant W as initWasm()
participant S as Wasm SDK
rect rgb(240, 255, 240)
note over E: getLatestVersionNumber (async)
C->>E: getLatestVersionNumber()
E->>W: await initWasm()
W-->>E: initialized
E->>S: getLatestVersionNumber()
S-->>E: number
E-->>C: Promise<number> resolved
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
packages/js-evo-sdk/src/sdk.ts
(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
packages/**/**/*.{js,ts,jsx,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
packages/**/**/*.{js,ts,jsx,tsx}
: Adhere to ESLint with Airbnb/TypeScript configs for JS/TS code
Use camelCase for JS/TS variables and functions
Use PascalCase for JS/TS classes
Prefer kebab-case filenames within JS packages
Files:
packages/js-evo-sdk/src/sdk.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
- GitHub Check: Build Docker images (Dashmate helper, dashmate-helper, dashmate-helper) / Build Dashmate helper image
- GitHub Check: Build Docker images (DAPI, dapi, dapi) / Build DAPI image
- GitHub Check: Build JS packages / Build JS
- GitHub Check: Build Docker images (Drive, drive, drive-abci) / Build Drive image
- GitHub Check: Rust crates security audit
Issue being fixed or feature implemented
Static version and logging methods aren't working.
What was done?
This pull request updates the logging and version retrieval methods in the
EvoSDK
class to ensure proper initialization of the WebAssembly module before use. Both methods are now asynchronous, which helps prevent runtime errors if the WASM module hasn't finished loading.How Has This Been Tested?
None
Breaking Changes
None
Checklist:
For repository code-owners and collaborators only
Summary by CodeRabbit