Skip to content
Merged
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.9.0
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 @@ -16,7 +16,7 @@
"lint:css:fix": "stylelint 'src/**/*.{vue,css,scss}' --fix"
},
"dependencies": {
"@eclipse-zenoh/zenoh-ts": "1.3.4",
"@eclipse-zenoh/zenoh-ts": "1.9.0",
"@ffmpeg/ffmpeg": "^0.12.15",
"@ffmpeg/util": "^0.12.2",
"@foxglove/rosmsg": "^5.0.4",
Expand Down
33 changes: 14 additions & 19 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 {
QueryTarget, Receiver, RecvErr, ReplyError, Sample, Session, Subscriber,
QueryTarget, ReplyError, Sample, Session, Subscriber,
} from '@eclipse-zenoh/zenoh-ts'
import axios from 'axios'
import { StatusCodes } from 'http-status-codes'
Expand All @@ -191,7 +191,7 @@ import {
import SpinningLogo from '@/components/common/SpinningLogo.vue'
import PullProgress from '@/components/utils/PullProgress.vue'
import filebrowser from '@/libs/filebrowser'
import zenoh from '@/libs/zenoh'
import zenoh, { receiveQueryReply, RecvErr } from '@/libs/zenoh'
import bag from '@/store/bag'
import { FilebrowserFile } from '@/types/filebrowser'
import { InstalledExtensionData, RunningContainer } from '@/types/kraken'
Expand Down Expand Up @@ -447,30 +447,26 @@ export default Vue.extend({
}

try {
const receiver: void | Receiver = this.file_sync_session.get(topic, {
const receiver = await this.file_sync_session.get(topic, {
target: QueryTarget.BestMatching,
})

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

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()
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())
const response = reply.result()
if (response instanceof Sample) {
const payload = response.payload().toString()
return this.parseFileSyncQueue(payload)
}
const errorResponse: ReplyError = response
console.warn(`[CloudTrayMenu] Query error for ${topic}:`, errorResponse.payload().toString())

reply = await receiver.receive()
reply = await receiveQueryReply(receiver)
}
} catch (error) {
console.error(`[CloudTrayMenu] Failed to query ${topic}:`, error)
Expand Down Expand Up @@ -518,13 +514,12 @@ 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) => {
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.

},
)
} catch (error) {
Expand All @@ -533,7 +528,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
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ export default Vue.extend({
this.modal_subscriber = await kraken.createExtensionLogsSubscriber(topic, this.handleSubscriber)
},
async handleSubscriber(sample: Sample) {
const payloadString = sample.payload().to_string()
const payloadString = sample.payload().toString()

let message = payloadString
try {
Expand Down
17 changes: 11 additions & 6 deletions core/frontend/src/components/zenoh-inspector/ZenohInspector.vue
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,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 @@ -215,12 +215,17 @@ 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())
try {
formattedMessage.payload = JSON.parse(message.payload.toString())
} catch (exception) {
// Keep the raw payload if it's not valid JSON
formattedMessage.payload = 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 @@ -234,7 +239,7 @@ export default Vue.extend({
this.session = await zenoh.getSession()

// 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 @@ -261,7 +266,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
Loading