[SOLVED] @actyx/pond: pond.events().observeEarliest throws EmptyError when no matching events exist

Using pond.events().observeEarliest(…) to get the earliest event throws “EmptyError: no elements in sequence” when no matching events for the query are available in ActyxOS. This error cannot be caught using try/catch.
Expected behavior
The documentation states “If there is an existing event fitting the query, onNewEarliest will be called with that event.” so I would expect it not to call onNewEarliest when no event is available and I wouldn’t expect it to throw an error.
@actyx/pond": “^2.5.1”

Please ask me for any additional information you need. I hope this is the right place to report this since I couldn’t find a public GitHub project for @actyx/pond.

Hi @sam.lk

Thanks for reporting this bug. We’ll get back to you :slight_smile:

Hi sam.lk,

thanks for the bug report!
I have just pushed a fix for the issue to npm with Pond version 2.5.2.
Let us know if that helps or whether there is anything still wrong.


ps. This forum is definitely a good place to report Pond bugs!
For organizational reasons, the Pond repository is currently a private one, even though of course the code is publicly visible inside the JS package anyways.


Hey Benjamin!

Your fix works just fine. Thanks for your help!

1 Like