LearnNewsExamplesServices
Frontmatter
id8691
titleFix ServiceWorker Fetch Failure on Cache Quota Exceeded
stateClosed
labels
bugaicore
assigneestobiu
createdAtJan 15, 2026, 2:25 PM
updatedAtJan 15, 2026, 2:27 PM
githubUrlhttps://github.com/neomjs/neo/issues/8691
authortobiu
commentsCount1
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtJan 15, 2026, 2:27 PM

Fix ServiceWorker Fetch Failure on Cache Quota Exceeded

tobiu
tobiu commented on Jan 15, 2026, 2:25 PM

If the Cache Storage quota is exceeded, the cache.put() call in onFetch throws an error. Currently, this error propagates up the promise chain returned to event.respondWith(), causing the successful network request to be treated as a failure by the browser. This results in broken/missing resources.

The fix is to catch errors from cache.put() and ensure the network response is returned regardless of caching success. Logging will be suppressed to avoid console noise.

tobiu
tobiu Jan 15, 2026, 2:26 PM

Input from Gemini 3 Pro:

✦ I have fixed the issue where QuotaExceededError during cache.put() would cause the fetch request to fail.

Fix Implemented:

  • Added a .catch() block to the cache.put() call in ServiceBase.onFetch.
  • This ensures that if the cache is full (or any other storage error occurs), the network response is still successfully returned to the browser.
  • Logging is suppressed to prevent console spam.

The changes have been pushed to dev.