top of page

Forum Comments

Service Worker outdated/not-updating
In Feature requests
Stephen Wicklund
Sep 29, 2023
Okay, apparently this issue is not specific to just my machine; a friend of mine hit the same issue. (where UrzaGatherer was stuck on a version that was around a year old) He tried the following: 1) Opening dev-tools, holding "Refresh", pressing "Hard Reload". That solved it for that one refresh, but did not permanently solve it. (ie. they need to have the dev-tools open and press hard-reload to fix it each time they want to visit the site) 2) Doing: dev-tools -> Application -> Storage -> Have only the "Cache storage" checkbox selected -> press "Clear site data" (apparently it had 945mb of cache storage used) After step 2, is when the issue was fixed for him (which matches with my own experience, fixing it several months ago). So as I suspected earlier, I think the problem is that: * Chrome has a limit on how much a website can store in its local storage and cache. * Over time, the cache fills up (presumably from card images) and ends up exceeding the limit. * Then, when UrzaGatherer tries to download the new version of the service-worker (which contains the app's code), it fails to do so, because storing the new version would increase the storage usage beyond the limit. Now, theoretically this shouldn't be the case -- because the "Application -> Storage" panel explicitly lists its "storage quota" (for me this is "1199813 MB"), and the actual usage is well below that quota. But I suspect there is some additional limit of some kind, which is being exceeded, causing service-worker downloading/updating to fail. In any case, it's a pretty serious problem, since when it fails to update the service-worker, it means any new sets are left out. And if the user does not have a technical background, they will almost certainly not be able to resolve the issue on their own. ========== Alternatively, perhaps the issue is not that a cache limit/quota is being exceeded, but rather that there is some kind of "special cache" that is used for service-workers, and it is somehow getting corrupted and unable to be updated in certain cases. Assuming this is the case, the only ways I've found to clear this "service worker cache" is either to: 1) Follow the "Step 2" at the top of this post. 2) Press the "Clear local cache" button in the UrzaGatherer settings. (this worked for me in the past) It's worth noting that simply pressing "Update" or "Unregister" for the service-worker (in dev-tools -> Application -> Service workers) does NOT fix the issue. (presumably it just keeps pulling from the "special service-worker cache" that still holds the old version) While pressing the "Clear local cache" button in settings appears to fix the issue, I've looked more recently and unfortunately it appears to have been removed; might be worth adding back. Anyway... my suggestion as a web-dev, in the absense of a "fundamental fix" for the issue, is a workaround like so: * Have some tiny additional "cache_checker.js" script file, which is loaded alongside the main codebase / service-worker, and which is never cached, to ensure that you can push changes to that cache-resolving script later if needed. (and in the case of the user running offline, it's fine for it not to load, since the service-worker could only get updated while online anyway) * The job of this extra script, is simply to check which version of the service-worker is running. (eg. indicated through a global/window-attached variable) * If the service-worker's version is not the latest, and it's been more than X days since the release of the latest version, then the caching bug has been detected; alert the user to the problem (perhaps a popup, or a banner at the top/bottom of the page), and ask if they want to attempt a fix. * The "fix" operation then consists of calling whatever function used to be attached to the "Clear local cache" button in the settings, and then refreshing the page. (since that's what fixed it for me in the past)
0
0
Recent Android update adds annoying address-bar
In Feature requests
Stephen Wicklund
Nov 17, 2022
@David Catuhe I tried opening urzagatherer.app in my Android Firefox, and got the same issue as discedunt (of deck cards being unclickable/unopenable). I connected my phone to my PC and opened dev-tools, and I think I found the issue... In "deckCard.tsx", there is the "DeckCard.onClick" handler, and in it, there is this code block: ``` if (_evt.buttons !== 0) { _evt.preventDefault(); _evt.stopPropagation(); return; } ``` In desktop Firefox the above works fine, because when clicked with an actual mouse, the "buttons" field has "0" as the value. (I tested by running this in console: `$0.onclick=e=>{console.log(e); debugger;}`) In mobile Firefox however, the "buttons" field has "1" as the value, when tapped with one's finger. (again, checked by running the code above in console) I have not 100% confirmed that the above is the issue (for example, it's possible React's synthetic-event uses a different value for the "buttons" field than the native value checked with my console code), but I'm pretty sure it is the cause of the problem. (I tried adding a breakpoint to the original code to confirm the value mismatch, but for some reason, the remote Firefox dev-tools was failing to insert the breakpoint in the place I wanted.) EDIT: Here is the MDN reference page on the subject (doesn't fully explain why Chrome gives a different value than Firefox on Android, but does show how both "0" and "1" are "valid values" for a left-click): https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/buttons
0
Service Worker outdated/not-updating
In Feature requests
Stephen Wicklund
Aug 28, 2022
Okay, I think I finally fixed the core issue. (knocking on wood) What I did (after disabling the workaround extension for blocking/gating all service-workers): 1) Closed all UrzaGatherer tabs. 2) Turned off my internet. 3) Opened UrzaGatherer, went to Settings, then pressed "Clear local cache" in the database section. 4) Turned internet back on. 5) Refreshed the page. (and again, and again, and in new tab, and with dev-tools open and closed, and with hard-refresh, etc. to make sure the fix persisted) So the key seems to be the "Clear local cache" button in the "Database" section at the bottom of settings. It's odd that that did it though, since as mentioned I already tried clearing all cache for UrzaGatherer through the dev-tools; but maybe UrzaGatherer has some kind of "cache" that is not seen by the dev-tools cache-clearing tool. If the app's "Clear local cache" button is not supposed to have anything to do with the service-worker code (ie. app version), then my suspicion is that maybe there was something about what the app was caching that was making the app's state "invalid" or "over a quota" or something, causing the attempt to update the cached service-worker code (to the newer versions) to consistently fail. And so by pressing "Clear local cache", it restores the app's state to something that wasn't invalid/over-quota, freeing that up. Anyway, the above is just a guess; the fix above worked for me (and without needing that service-worker-blocker extension anymore), so I am content not knowing the full details.
0
0

Stephen Wicklund

More actions
bottom of page