Open amcgregor opened 1 year ago
Required corrections across two packages:
Resource dispatch updated to utilize Crumb
named tuple class: https://github.com/marrow/web.dispatch.resource/commit/751d656a71179c09bb5dd2cad7e5c880b01d70c3
Tuple length bounds check had inverted comparisons: https://github.com/marrow/web.dispatch/commit/7fb9dbd83999113fae636881f684fb0da58e9244
The second was difficult to initially see as this code path is only used when .replace()
ing tuple elements. The MCVE operates correctly using checkouts of these commits.
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 beenget
. 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.