Skip to content

Update zenoh and enable shared memory#3953

Merged
patrickelectric merged 9 commits into
bluerobotics:masterfrom
joaoantoniocardoso:update_zenoh_and_enable_shared_memory
Jun 24, 2026
Merged

Update zenoh and enable shared memory#3953
patrickelectric merged 9 commits into
bluerobotics:masterfrom
joaoantoniocardoso:update_zenoh_and_enable_shared_memory

Conversation

@joaoantoniocardoso

@joaoantoniocardoso joaoantoniocardoso commented Jun 15, 2026

Copy link
Copy Markdown
Member

This PR:

  • Migrates both the Backend (zenohd + the two Python venvs) and Frontend Zenoh to 1.9.0.
  • Fixes the missing schema for the frontend logs.

Note: If we want zenohd to use shared memory, I might need to build it ourselves.

Comment thread core/libs/commonwealth/src/commonwealth/utils/zenoh_helper.py Outdated
Comment thread core/tools/zenoh/blueos-zenoh.json5 Outdated
@joaoantoniocardoso joaoantoniocardoso marked this pull request as ready for review June 15, 2026 16:53
sourcery-ai[bot]

This comment was marked as outdated.

@joaoantoniocardoso joaoantoniocardoso force-pushed the update_zenoh_and_enable_shared_memory branch from a953ca8 to 074e56b Compare June 15, 2026 17:10
@joaoantoniocardoso joaoantoniocardoso marked this pull request as draft June 15, 2026 17:40
@bluerobotics bluerobotics deleted a comment from github-actions Bot Jun 15, 2026
@joaoantoniocardoso joaoantoniocardoso marked this pull request as ready for review June 15, 2026 21:12

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 2 issues, and left some high level feedback:

  • The custom RecvErr.MalformedReply enum value is never produced by receiveQueryReply, but some callers (e.g. CloudTrayMenu) branch on it; consider either implementing malformed reply detection or removing that enum value and the associated branches to avoid dead code paths.
  • Several places duplicate the same "create query receiver, iterate replies until disconnected" pattern (e.g. in ZenohNetwork.vue, CloudTrayMenu.vue, and libs/zenoh/index.ts); consider extracting a shared helper to centralize this logic and keep future zenoh API migrations confined to one place.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The custom `RecvErr.MalformedReply` enum value is never produced by `receiveQueryReply`, but some callers (e.g. `CloudTrayMenu`) branch on it; consider either implementing malformed reply detection or removing that enum value and the associated branches to avoid dead code paths.
- Several places duplicate the same "create query receiver, iterate replies until disconnected" pattern (e.g. in `ZenohNetwork.vue`, `CloudTrayMenu.vue`, and `libs/zenoh/index.ts`); consider extracting a shared helper to centralize this logic and keep future zenoh API migrations confined to one place.

## Individual Comments

### Comment 1
<location path="core/frontend/src/libs/zenoh/index.ts" line_range="5-7" />
<code_context>
+
+// zenoh-ts 1.9 no longer exports Receiver/RecvErr; the get() channel rejects receive() on close
+// (and the query has its own timeout), so we just map that rejection to Disconnected.
+export enum RecvErr {
+  Disconnected,
+  MalformedReply,
+}
+
</code_context>
<issue_to_address>
**issue (bug_risk):** RecvErr.MalformedReply is never produced by receiveQueryReply, making callers’ MalformedReply handling unreachable.

`receiveQueryReply()` currently only returns `Reply` or `RecvErr.Disconnected` (on rejection), so there’s no path that yields `RecvErr.MalformedReply`. Callers like `CloudTrayMenu.queryFileSyncQueue` that branch on `MalformedReply` are therefore dead code. Please either wire malformed replies through to `RecvErr.MalformedReply` (e.g., via parsing error handling in `receiveQueryReply`) or remove `MalformedReply` and the unused branches to keep the enum and its usage consistent.
</issue_to_address>

### Comment 2
<location path="core/frontend/src/components/cloud/CloudTrayMenu.vue" line_range="461-462" />
<code_context>
-        let reply = await receiver.receive()
+        let reply = await receiveQueryReply(receiver)
         while (reply !== RecvErr.Disconnected) {
           if (reply === RecvErr.MalformedReply) {
             console.warn(`[CloudTrayMenu] Malformed reply while querying ${topic}.`)
           } else {
             const response = reply.result()
</code_context>
<issue_to_address>
**issue (bug_risk):** MalformedReply branch appears unreachable given current receiveQueryReply implementation.

Since `receiveQueryReply` only returns a `Reply` or `RecvErr.Disconnected`, this `MalformedReply` case is currently unreachable and malformed replies will instead be handled by the outer `catch`. Once you decide whether `receiveQueryReply` should throw on malformed input or return `RecvErr.MalformedReply`, please align this branch with that behavior or remove it.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment thread core/frontend/src/libs/zenoh/index.ts Outdated
Comment thread core/frontend/src/components/cloud/CloudTrayMenu.vue Outdated
@github-actions

This comment was marked as resolved.

@joaoantoniocardoso joaoantoniocardoso force-pushed the update_zenoh_and_enable_shared_memory branch from 8b2a761 to 40a8d51 Compare June 15, 2026 21:49
handler: (sample: Sample) => {
this.handleUploadingSample(sample)
},
history: true,

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could keep it, but this was already dead code in 1.3.4.

@joaoantoniocardoso joaoantoniocardoso force-pushed the update_zenoh_and_enable_shared_memory branch from a7d61c9 to bb2e75b Compare June 15, 2026 23:07

@joaoantoniocardoso joaoantoniocardoso left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-tested; all working.

Question for reviewers: should we squash 40a8d51 onto 4d0d578, or drop it?

@joaoantoniocardoso

Copy link
Copy Markdown
Member Author

ping @nicoschmdt @patrickelectric

@patrickelectric

Copy link
Copy Markdown
Member

Re-tested; all working.

Question for reviewers: should we squash 40a8d51 onto 4d0d578, or drop it?

I believe that is not necessary

@patrickelectric

Copy link
Copy Markdown
Member

Re-tested; all working.
Question for reviewers: should we squash 40a8d51 onto 4d0d578, or drop it?

I believe that is not necessary

Looking again, I believe that is necessary indeed

Comment thread core/frontend/src/libs/console-logger.ts Outdated
@nicoschmdt

Copy link
Copy Markdown
Collaborator

Re-tested; all working.

Question for reviewers: should we squash 40a8d51 onto 4d0d578, or drop it?

I think we should squash the fixup

@joaoantoniocardoso joaoantoniocardoso force-pushed the update_zenoh_and_enable_shared_memory branch from df9781b to ebfa91b Compare June 22, 2026 19:10
… ready callback

makeEvents is undefined; the ready callback always threw.
…ainst Vue reactivity

Vue 2 deep-observed the Core; fcose per-frame mutations froze the tab
@joaoantoniocardoso joaoantoniocardoso force-pushed the update_zenoh_and_enable_shared_memory branch from ebfa91b to 4c90067 Compare June 24, 2026 17:57
@joaoantoniocardoso

Copy link
Copy Markdown
Member Author

Rebased.

@patrickelectric patrickelectric merged commit f233b09 into bluerobotics:master Jun 24, 2026
7 checks passed
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.

3 participants