Skip to content

Commit

Permalink
Merge pull request #91 from nevermined-io/fix/missed-logs
Browse files Browse the repository at this point in the history
fix: missed logs
  • Loading branch information
eruizgar91 authored Dec 11, 2024
2 parents 44fce9b + fd53181 commit 8122be1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nevermined-io/payments",
"version": "0.7.4",
"version": "0.7.5",
"description": "Typescript SDK to interact with the Nevermined Payments Protocol",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
Expand Down
8 changes: 5 additions & 3 deletions src/api/nvm-backend.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import axios from 'axios'
import { decodeJwt } from 'jose'
import { io } from 'socket.io-client'
import { sleep } from '../common/helper'
import { AgentExecutionStatus, TaskLogMessage, TaskCallback } from '../common/types'
import { isEthereumAddress } from '../utils'
import { PaymentsError } from '../common/payments.error'
import { AgentExecutionStatus, TaskCallback, TaskLogMessage } from '../common/types'
import { isEthereumAddress } from '../utils'

export interface BackendApiOptions {
/**
Expand Down Expand Up @@ -214,7 +214,9 @@ export class NVMBackendApi {
})

await this.socketClient.emit('_join-tasks', JSON.stringify({ tasks, history }))
await this.socketClient.on('task-log', this.handleTaskLog.bind(this, tasks))
this.socketClient.on('_join-tasks_', async () => {
this.socketClient.on('task-log', this.handleTaskLog.bind(this, tasks))
})
} catch (error) {
throw new PaymentsError(
`Unable to initialize websocket client: ${this.opts.webSocketHost} - ${(error as Error).message}`,
Expand Down

0 comments on commit 8122be1

Please sign in to comment.