begerdom · GitHub

Bug description

When having a link that navigates to an error response via up-follow and unpoly caching is enabled, the navigation fails sporadically and Unpoly throws an error in the console:

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'satisfies')
    at Cache.<anonymous> (unpoly.js:6551:61)
    at Generator.next (<anonymous>)
    ...

image

Reproduction project

https://codepen.io/dbforge/pen/vYodeWa

Steps to reproduce the behavior:

The error is not directly reproducable on CodePen. It just follows the link and replaces the complete page there instead of updating the fragment. I think you need to set this up on the same host with a relative URL. However, the code is exactly the one I am using to reproduce this in my app.
The href-target should render a valid HTML response with a 403 status code.

Expected behavior

I would expect it to just follow the link and update the specified (fail) target instead, i.e. not throw an error.

Browser version

  • OS: Ubuntu 20.04
  • Browser Chrome
  • Version 129.0.6668.70

Additional context

This happened to me since using Unpoly 3.10.0-alpha1 which I needed for another bugfix. In the previously used version 3.0.0, this did not happen.
When explicitly applying up-cache="false", the error does not occur.

Read the original on github.com ↗