eclipse / kuksa.val

kuksa.val
Apache License 2.0
89 stars 52 forks source link

INFO-3 Subscription channels remain open after token expiration #751

Closed lukasmittag closed 2 months ago

lukasmittag commented 3 months ago

This fixes that a subscription channel stays open after the token of the subscriber has expired. We need to decide if we want to fix this. Currently it is only fixed for ChangeSubscription which the new API uses. If we want to do it for the old query subscription as well it can be done similiar. To test it take a jwt token of kuksa-val/jwt/ and use a timestamp that expires in the near future -> go to https://www.epochconverter.com/ for timestamps ;)

It is not that pretty in code I think so do not now if we want to fix this in this way/at all. One observation I made was that even if the channel is kept open somehow if you update the token new updates do not come in in the databroker-cli again. Haven't figured out why yet.

lukasmittag commented 3 months ago

and I opted for closing if a new notification would be sent out so no general repeated check. This means if you do not update soem things channel can stay open a while.

rafaeling commented 3 months ago

Code looks fine to me, tested with python sdk and the channel closes correclty

lukasmittag commented 3 months ago

I just thought that it's maybe not the ideal way code wise. But since @argerus had nothing to complain yet :) From my side we can merge.

erikbosch commented 2 months ago

Databroker has been migrated to https://github.com/eclipse-kuksa/kuksa-databroker. Please open a new pull request in that repo.