twirapp/twir

Implement user subscription to audit log on backend

Closed this issue · 0 comments

https://github.com/twirapp/twir/pull/761/files#diff-80f85c8f6fb030a1499ec7b7d5defd0fed0bffb4baeb12497fb99d00c7ef4ef7

This gql subscription should be implemented.

i think we need 1 global channel per application, for subscribing on changes. So, this bus will send us all events, and we manually filter audit's by some criteria in piece of code. For example this will give us opportunity to listen changes in 2 places in 1 app, for example listen in user gql subscription, and for example just for logging in another place for channels_commands change`

When user subscribing to this channel, we retrieve his selected dashboardId via r.sessions.GetSelectedDashboard(ctx) function call, and filter inside this subscription implementation by this channel id.