Identifying DO namespaces by the existence of idFromName
will soon have false positives
#48
Labels
bug
Something isn't working
idFromName
will soon have false positives
#48
itty-durable currently scans all bindings (the contents of
env
) to find Durable Object namespace bindings. It decides that a binding is a DO namespace if it has a methodidFromName
.itty-durable/src/itty-durable.js
Lines 32 to 36 in 86c8f01
In the near future, Workers will introduce a binding type that is a proxy object which appears to have methods of every possible name. Hence, this binding type will incorrectly be detected as a Durable Object namespace.
It appears the effects of this are mostly benign, but it might be worth tightening the test. I think you could perhaps detect these proxy objects by also checking for the presence of an unlikely method name, like
__methodThatWillNeverBeDefined
or something. If that exists and is a function, you are probably looking at a proxy and not a DO namespace.The text was updated successfully, but these errors were encountered: