nats-io / nats.py

Python3 client for NATS
https://nats-io.github.io/nats.py/
Apache License 2.0
874 stars 184 forks source link

Impossible to watch forever #580

Open skewty opened 2 months ago

skewty commented 2 months ago

Observed behavior

Both zero and None values are falsey so watching forever becomes impossible.

Expected behavior

Change the check to if inactive_threshold is None: so None gives auto timeout but explicit 0 and 0.0 are accepted and not overriden.

Server and client version

nats-py 2.8.0

nats-server 2.10.17

Host environment

No response

Steps to reproduce

See code line referenced. https://github.com/nats-io/nats.py/blob/981e5d6f0dfa944c8be9b4ee49ffdbd11786742c/nats/js/kv.py#L441C9-L441C34