Skip to content

Commit

Permalink
fix reports (#167)
Browse files Browse the repository at this point in the history
* fix reports

* transform sidecar bus data in pipelines

* call callback at the end of busTransformer

* fix reports tweaks

---------

Co-authored-by: rafapaezbas <[email protected]>
  • Loading branch information
2 people authored and davidmarkclements committed Jun 4, 2024
1 parent 30a173c commit 05842c1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
4 changes: 2 additions & 2 deletions decal.html
Original file line number Diff line number Diff line change
Expand Up @@ -649,9 +649,9 @@ <h1 id="header">Unknown app</h1>
document.documentElement.classList.add('dialog')
document.body.appendChild(ctrl)
document.body.appendChild(trustConfirm)
trustConfirm.setLink(report.key.link)
trustConfirm.setLink(key.link)
trustConfirm.trust = async () => {
await this.ipc.trust({ z32: report.key.z32 })
await this.ipc.trust({ z32: key.z32 })
await this.ipc.restart({ id: this.gid })
}

Expand Down
15 changes: 12 additions & 3 deletions subsystems/sidecar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ class Sidecar extends ReadyResource {
messages (ptn) {
const subscriber = this.sidecar.bus.sub({ topic: 'messages', id: this.id, ...(ptn ? { data: ptn } : {}) })
const stream = new streamx.PassThrough({ objectMode: true })
streamx.pipeline(subscriber, stream)
streamx.pipeline(subscriber, pickData(), stream)
return stream
}

Expand Down Expand Up @@ -359,7 +359,7 @@ class Sidecar extends ReadyResource {
warming (params, client) {
if (!client.userData) return
const stream = new streamx.PassThrough({ objectMode: true })
streamx.pipeline(client.userData.warming, stream)
streamx.pipeline(client.userData.warming, pickData(), stream)
return stream
}

Expand All @@ -370,7 +370,8 @@ class Sidecar extends ReadyResource {
reports (params, client) {
if (!client.userData) return
const stream = new streamx.PassThrough({ objectMode: true })
streamx.pipeline(client.userData.reporter, stream)
streamx.pipeline(client.userData.reporter, pickData(), stream)
return stream
}

createReport (err, client) {
Expand Down Expand Up @@ -776,4 +777,12 @@ class Sidecar extends ReadyResource {
}
}

function pickData () {
return new streamx.Transform({
transform ({ data }, cb) {
cb(null, data)
}
})
}

module.exports = Sidecar

0 comments on commit 05842c1

Please sign in to comment.