plgd-dev/hub

Retrieving a published resource incorrectly gives 404 if its payload is not present in cache yet

kurattila opened this issue · 0 comments

Description

Plgd/hub incorrectly indicates that a resource payload which is currently not in cache, will not ever be in cache, either.

How can it be reproduced?

  1. Register a device and wait for its registered event
  2. Wait for resources published event (but don't wait for any cache updated events)
  3. Try retrieving cached value of an already published resource => will return 404, since payload is missing from cache
  4. Client won't ever retry retrieving that same resource value, since 404 denotes it makes no sense to retry, in general

Environment

  • plgd Docker containers tag: 2.4.2

Additional context

Returning 503 instead of 404 would make the client know that after some retries, the payload is going to be present.