Closed mdastous-bentley closed 5 months ago
Thank you for the report, could you please give us the url that you're using?
Actually if you could provide a more complete reproduction case, i.e. a simple script showcasing the error, that would be really helpful. Thanks!
I tried with 3 different URL, result is the same. I feel like the cache on my machine got corrupted somehow and cannot be recovered. Is there anything I can do to clear any previous cache entry ?
Complete code here really:
const url = "https://ahocevar.com/geoserver/wfs";
const endpoint = new WfsEndpoint(url);
await endpoint.isReady();
Which sandbox can I use that got ogc-client pre-installed ?
I created a codesandbox to try to reproduce this but I couldn't: https://codesandbox.io/p/devbox/tqp983
I feel like the cache on my machine got corrupted somehow and cannot be recovered. Is there anything I can do to clear any previous cache entry ?
You can go to the "application" tab of your dev tools, there should be an "ogc-client" entry that you can delete.
Do you reproduce the issue with another browser, or with a private navigation tab?
I made further investigations on this, and it appears Cache api doesn't work properly when the application is launched from VS Code (pwa-chrome).
I even checked cache entries before calling WfsEnpoint functions, using this code:
const cache = await caches.open('ogc-client');
console.log(await cache.keys());
and it returns an empty array, but still the call to cache.put
will fail complaining about existing key.
Ok then we can simply catch any error happening when writing in the cache and, in case of an error, disable the cache. Thanks for the report!
Using this two lines of code:
I get this exception:
Initially it was working fine, but suddenly it started throwing this error.
This is the call causing the exception (I cannot step i further):