raiden-network / raiden-services

Development of the Raiden Monitoring and Pathfinding Services
MIT License
10 stars 18 forks source link

Metadata isn't updated when node's capabilities changes #1025

Open andrevmatos opened 3 years ago

andrevmatos commented 3 years ago

Problem Definition

On the LC, we have some capabilities which can be updated at runtime. e.g.: by default, Receive is set to 1 if there's enough UDC balance to pay for one monitoring request, and to 0 if e.g. a udc withdraw process is initiated which makes it drop below the minimum required UDC deposit.

When these capabilities changes, we PUT the new avatar_url to the respective endpoint in our matrix server, AND after that also PUT a new status with the same online presence but a changed status_msg in order to force a m.presence update to be sent for us. Not sure if any/all of these cases aren't properly propagated by the matrix hook, or if the PFS is not reacting to these events, but it seems the PFS does not update our metadata when capabilities updates are posted, which is breaking functionality which depends on these staying more or less up to date.

Workaround for now in the user side is to disconnect, stay offline for ~30s (to be seen as offline by matrix), then coming back online and only then our capability is updated (since we came back online with the new capability). One bug in our repo caused by this issue: https://github.com/raiden-network/light-client/issues/2831

Actual Outcome

Capability isn't updated without going offline and then coming back online

Expected Outcome

PFS can pick up avatar_url updates (and/or status updates) and update our capabilities accordingly.

andrevmatos commented 3 years ago

We managed to implement a workaround in https://github.com/raiden-network/light-client/pull/2838 by quickly switching to offline then back to online upon capabilities changes, but of course this isn't ideal, PFS should listen to presence updates and avatar_url changes and update the capabilities accordingly.