-
Notifications
You must be signed in to change notification settings - Fork 48
feat(browser-tests): update waku dependencies, add nwaku-style log for light push #2742
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
base: master
Are you sure you want to change the base?
Conversation
size-limit report 📦
|
8b0c1e0 to
89f4a6d
Compare
|
@adklempner is this PR reviewable? |
Yes |
| } | ||
|
|
||
| function makeSerializable(result: SDKProtocolResult): SerializableSDKProtocolResult { | ||
| function makeSerializable(result: { successes: PeerId[], failures: Array<{ error: any, peerId?: PeerId }> }): SerializableSDKProtocolResult { |
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.
nit: create local type
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.
Pull request overview
This PR updates the @waku/browser-tests package to use the latest Waku SDK dependencies (v0.0.36) to support LightPush v3, and adds nwaku-style logging for successfully sent light push messages. The changes enable compatibility with the updated protocol version and provide better observability through standardized logging.
Key Changes:
- Updated
@waku/sdkfrom v0.0.34 to v0.0.36,@waku/discoveryfrom v0.0.11 to v0.0.13, and@waku/interfacesfrom v0.0.33 to v0.0.34 - Refactored message sending to use
IMessageinterface with proto object conversion - Added message hash calculation and nwaku-compatible logging format for successful light push operations
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/browser-tests/package.json | Updated Waku dependency versions to latest releases |
| packages/browser-tests/web/index.ts | Refactored to use IMessage interface, added messageHashStr import from @waku/core, enhanced SerializableSDKProtocolResult with messageHash field, and implemented message hash calculation |
| packages/browser-tests/src/routes/waku.ts | Added nwaku-style logging with message hash and peer information for successful light push operations |
| package-lock.json | Updated dependency lock file to reflect new package versions and transitive dependencies |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| return { | ||
| success: false, | ||
| error: "Could not publish message: no suitable peers", | ||
| error: lightPushResult.failures[0].error, |
Copilot
AI
Dec 9, 2025
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.
Potential runtime error: accessing lightPushResult.failures[0] without checking if the failures array exists or has elements. This could throw an error if failures is undefined or empty. Consider adding a check like lightPushResult.failures?.length > 0 ? lightPushResult.failures[0].error : "Unknown error" or similar.
| error: lightPushResult.failures[0].error, | |
| error: (lightPushResult.failures && lightPushResult.failures.length > 0 && lightPushResult.failures[0].error) ? lightPushResult.failures[0].error : "Unknown error", |
Problem / Description
The browser-tests package was using an older version of
@waku/sdkthat wasn't using LightPush v3. This broke expected behavior in testing environment.Solution
Update browser-tests to use latest versions of other js-waku packages
Also adds nwaku-style log upon successfully sending light push message
Notes
Checklist