WebCore icon indicating copy to clipboard operation
WebCore copied to clipboard

Dispatch issue during migration from object to resource dispatchers.

Open amcgregor opened this issue 1 year ago • 1 comments

In a very non-obvious chain of misfortune, attempting to adapt some WebCore 1 endpoints to WebCore 2 semantics resulted in very strange issues. Specifically, attempting to navigate below a collection, to a resource, resulted in the collection itself loading rather than the resource.

Root cause: __call__ (object dispatch replacement for WebCore 1's __default__) was left behind and was eagerly used (is_endpoint=True) when the correct method should have been get. There may be a boundary issue where object dispatch is making an authoritative claim about the suitability of the handler, despite needing dispatch transition.

An MCVE has been produced; __call__ will be called with the remaining path elements in preference to __getitem__ and resource dispatch.

amcgregor avatar Dec 22 '22 15:12 amcgregor