I have a Siesta resource to which I use the closure version of AddObserver
. Right now, the endpoint that that resource uses always returns a 404. Most of the time, the observing closure only gets called once with the error. However, I have a log file where I see the exact same error (same timestamp and everything) being called twice. The error looks like this:
RequestError(userMessage: "Not found", httpStatusCode: Optional(404), entity: Optional(Siesta.Entity<Any>(content: "<h2>404 - Page Not Found</h2><p>The page could not be found.</p>", charset: Optional("utf-8"), headersNormalized: ["access-control-allow-headers": "Content-Type, Authorization", "set-cookie": "connect.sid=s%3APGOwgU4q3fhlxhag0E9Sc1zN_R9jTjH0.IAp%2BfAIfqxqP%2Bt5zZ1f0t1terpWgoRHpQhF%2BfB0gxyw; Path=/; HttpOnly", "etag": "W/\"40-ca3ea152\"", "via": "1.1 vegur", "content-length": "64", "content-type": "text/html; charset=utf-8", "date": "Sun, 17 Sep 2017 01:05:43 GMT", "access-control-allow-methods": "DELETE,GET,PATCH,POST,PUT", "connection": "keep-alive", "x-powered-by": "Express", "vary": "Accept-Encoding", "server": "Cowboy", "access-control-allow-origin": "*"], timestamp: 527303143.37699503)), cause: nil, timestamp: 527303143.37563998)
Are there cases where I should receive this error twice? Is it not a guarantee that the observer is only called once in this situation? Is it a bug??? Is that bug in Siesta, the networking library, or my code?