As of now on-demand peer discovery happens when no peer is available for a particular protocol and pubsubTopic specified in a protocol API such as publish/light publish/filter subscribe.
This discovery doesn't have an internal timeout and rather depends on the caller context and runs discovery until then.
Details
As explained here it is not great dev-ex, especially if no error is returned in such case.
It would be good to have a configurable timeout for discovery and return appropriate error in case peers could not be discovered for specified criteria.
Background
As of now on-demand peer discovery happens when no peer is available for a particular protocol and pubsubTopic specified in a protocol API such as publish/light publish/filter subscribe. This discovery doesn't have an internal timeout and rather depends on the caller context and runs discovery until then.
Details
As explained here it is not great dev-ex, especially if no error is returned in such case. It would be good to have a configurable timeout for discovery and return appropriate error in case peers could not be discovered for specified criteria.