Search code examples
node.jsreactjswebsocketfeathersjs

Why Feathers client watch doesn't work sometimes (websocket, always listStrategy)


We have a websocket connection in a Feathers application but it sometimes works, sometimes doesn't, you can see the clients codes here:

   return feathersClient
      .service('donations')
      .watch({ listStrategy: 'always' })
      .find({
        query: {
          lessThanCutoff: { $ne: true },
          status: { $ne: Donation.FAILED },
          $or: [{ intendedProjectTypeId: id }, { ownerTypeId: id }],
          $limit: 0,
        },
      })

https://github.com/Giveth/giveth-dapp/blob/f3d019cf4f7142077fe2910ae6de71ca78b5a4e0/src/services/MilestoneService.js#L357-L378

and feathers config in server here: https://github.com/Giveth/feathers-giveth/blob/develop/src/app.js


Solution

  • Downgrading feathers-socketio has fixed the issue, you can checkout my PR in our project

    https://github.com/Giveth/giveth-dapp/pull/2125/files