feat(browser-tests): update waku dependencies, add nwaku-style log for light push#2742
feat(browser-tests): update waku dependencies, add nwaku-style log for light push#2742adklempner wants to merge 3 commits intomasterfrom
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.
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, |
There was a problem hiding this comment.
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