"QuotaExceededError The quota has been exceeded" in packages/browser/src/lib/priority-queue/persisted.ts#L73.

Open
#1,200 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
48/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
typescript
Domain
frontend, web-dev

Research direction

Start in packages/browser/src/lib/priority-queue/persisted.ts at line 73 and inspect the localStorage.setItem operation reported by Sentry. Check how persisted queue errors are handled and add coverage for the Safari QuotaExceededError case if the surrounding tests provide a suitable entry point. Done means quota failures no longer surface as unhandled localStorage errors.

Written by the indexing model from the issue text.

Description

bug enhancement
Description

We have received a report in Sentry related to @segment/analytics-next package, which indicates that some localStorage operations are throwing QuotaExceededError The quota has been exceeded.. The trace points to https://github.com/segmentio/analytics-next/blob/master/packages/browser/src/lib/priority-queue/persisted.ts#L73.

image

Possible fix

In order to prevent such issues, it's recommended to wrap any localStorage.setItem() calls in try/catch block (see SO thread).

Device details

Browser
Name Safari
Version 17.6

Operating System
Name Mac OS X
Version >=10.15.7

Dominant language
TypeScript
Stars
477
Forks
160
Avg merge
6h 19m
Merged PRs (30d)
4

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from segmentio/analytics-next

All issues in segmentio/analytics-next

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.