Closed fabien closed 12 years ago
Definitely. Thanks for noticing the bug!
I just encountered my own bug today so I will roll both of these into a new test suite.
Okay, I finally realized that this is an error event. Perhaps Follow could keep pinging the database without throwing an error, but there are two problems with that:
inactivity_ms
setting, but then there's no way to distinguish between an idle database and a deleted database.So a database deletion falls under the "your application might be in trouble" category. Now it actually detects that situation and returns a meaningful error instead of the old "I have no idea what just happened" error.
Thanks again for the bug report! This one was fun.
Thanks for looking into it! In the end it makes the most sense to mark it as an error, indeed.
You're welcome. Note, I have not added to the documentation, but you can check the error object for .deleted
or .last_seq
to identify this type of failure.
Currently Follow will stop if the db being followed is deleted, or recreated:
Change has no .seq field: {"last_seq":7}
This could be problematic but I guess Follow should be aware of such situations and restart the process without raising an exception (or perhaps make this configurable).