Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ Before adding ANY dependency, check all `pyproject.toml` files. Use exact versio

```toml
aiohttp>=3.7.4,<=3.13.2
eclipse-zenoh==1.4.0
eclipse-zenoh==1.7.2
fastapi-versioning==0.9.1
fastapi==0.105.0
loguru==0.5.3
Expand Down
Binary file modified core/frontend/bun.lockb
Binary file not shown.
2 changes: 1 addition & 1 deletion core/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"lint": "eslint --max-warnings=0 --ext .js,.vue --ignore-path .gitignore --ignore-pattern src/components/vue-tour src"
},
"dependencies": {
"@eclipse-zenoh/zenoh-ts": "1.3.4",
"@eclipse-zenoh/zenoh-ts": "1.7.2",
"@ffmpeg/ffmpeg": "^0.12.15",
"@ffmpeg/util": "^0.12.2",
"@foxglove/rosmsg": "^5.0.4",
Expand Down
33 changes: 13 additions & 20 deletions core/frontend/src/components/cloud/CloudTrayMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@

<script lang="ts">
import {
Config, QueryTarget, Receiver, RecvErr, ReplyError, Sample, Session, Subscriber,
ChannelReceiver, Config, QueryTarget, Reply, ReplyError, Sample, Session, Subscriber,
} from '@eclipse-zenoh/zenoh-ts'
import axios from 'axios'
import { StatusCodes } from 'http-status-codes'
Expand Down Expand Up @@ -463,30 +463,23 @@ export default Vue.extend({
}

try {
const receiver: void | Receiver = this.file_sync_session.get(topic, {
target: QueryTarget.BestMatching,
const receiver: ChannelReceiver<Reply> | undefined = await this.file_sync_session.get(topic, {
target: QueryTarget.BEST_MATCHING,
})

if (!(receiver instanceof Receiver)) {
if (!receiver) {
console.warn(`[CloudTrayMenu] Query for ${topic} returned void receiver.`)
return null
}

let reply = await receiver.receive()
while (reply !== RecvErr.Disconnected) {
if (reply === RecvErr.MalformedReply) {
console.warn(`[CloudTrayMenu] Malformed reply while querying ${topic}.`)
} else {
const response = reply.result()
if (response instanceof Sample) {
const payload = response.payload().to_string()
return this.parseFileSyncQueue(payload)
}
const errorResponse: ReplyError = response
console.warn(`[CloudTrayMenu] Query error for ${topic}:`, errorResponse.payload().to_string())
for await (const reply of receiver) {
const response = reply.result()
if (response instanceof Sample) {
const payload = response.payload().toString()
return this.parseFileSyncQueue(payload)
}

reply = await receiver.receive()
const errorResponse: ReplyError = response
console.warn(`[CloudTrayMenu] Query error for ${topic}:`, errorResponse.payload().toString())
}
} catch (error) {
console.error(`[CloudTrayMenu] Failed to query ${topic}:`, error)
Expand Down Expand Up @@ -534,7 +527,7 @@ export default Vue.extend({
}

try {
this.uploading_subscriber = await this.file_sync_session.declare_subscriber(
this.uploading_subscriber = await this.file_sync_session.declareSubscriber(
MAJOR_TOM_FILE_SYNC_UPLOADING_TOPIC,
{
handler: (sample: Sample) => {
Expand All @@ -549,7 +542,7 @@ export default Vue.extend({
},
handleUploadingSample(sample: Sample): void {
try {
const payload = sample.payload().to_string()
const payload = sample.payload().toString()
const event = JSON.parse(payload) as FileSyncUploadingEvent
const transfer = this.normalizeUploadingEvent(event)
if (!transfer) {
Expand Down
12 changes: 6 additions & 6 deletions core/frontend/src/components/zenoh-inspector/ZenohInspector.vue
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ export default Vue.extend({
if (!this.current_message?.payload || !this.video_reader) {
return null
}
const msg: { data: Uint8Array } = this.video_reader.readMessage(this.current_message.payload.to_bytes())
const msg: { data: Uint8Array } = this.video_reader.readMessage(this.current_message.payload.toBytes())
return msg.data
},
},
Expand Down Expand Up @@ -213,12 +213,12 @@ export default Vue.extend({
}

if (message.encoding === Encoding.TEXT_PLAIN.toString()) {
formattedMessage.payload = message.payload.to_string()
formattedMessage.payload = message.payload.toString()
} else if (message.encoding === Encoding.APPLICATION_JSON.toString()) {
formattedMessage.payload = JSON.parse(message.payload.to_string())
formattedMessage.payload = JSON.parse(message.payload.toString())
} else if (message.encoding === Encoding.ZENOH_BYTES.toString()) {
try {
formattedMessage.payload = JSON.parse(message.payload.to_string())
formattedMessage.payload = JSON.parse(message.payload.toString())
} catch (exception) {
// Keep the raw payload if it's not valid JSON
formattedMessage.payload = message.payload.toString()
Expand All @@ -235,7 +235,7 @@ export default Vue.extend({
this.session = await Session.open(config)

// Setup regular message subscriber
this.subscriber = await this.session.declare_subscriber('**', {
this.subscriber = await this.session.declareSubscriber('**', {
handler: async (sample: Sample) => {
const topic = sample.keyexpr().toString()
const payload = sample.payload()
Expand All @@ -262,7 +262,7 @@ export default Vue.extend({
// Setup liveliness subscriber
const lv_ke = '@/**/@ros2_lv/**'

this.liveliness_subscriber = await this.session.liveliness().declare_subscriber(lv_ke, {
this.liveliness_subscriber = await this.session.liveliness().declareSubscriber(lv_ke, {
handler: (sample: Sample) => {
// Parse the liveliness token using regex
// eslint-disable-next-line max-len
Expand Down
Loading