Skip to content

fix: batch storage reads to reduce API calls with DLP extensions - #8

Merged
justcarlson merged 1 commit into
masterfrom
fix/batch-storage-reads
Jan 27, 2026
Merged

justcarlson merged 1 commit into
masterfrom
fix/batch-storage-reads

Conversation

@justcarlson

Copy link
Copy Markdown
Owner

Summary

  • Batch multiple chrome.storage.local.get() calls into single calls
  • Reduces storage API calls by ~50% per navigation event
  • Mitigates slowness caused by DLP extensions (like Incydr) monitoring API calls

Problem

DLP extensions add latency to each chrome.* API call. The extension was making 2-3 separate storage reads per navigation event when they could be combined.

Solution

Added loadAll() function that reads both urlDetection and quicktab_state in a single API call instead of separate calls.

// Before: 2 separate storage reads
const detection = await getUrlDetection();
const state = await loadState();

// After: 1 batched storage read
const { mode, state } = await loadAll();

Test plan

  • All 100 unit tests pass
  • 5 new tests for loadAll() function
  • Build succeeds
  • Lint passes

@justcarlson
justcarlson merged commit c8964aa into master Jan 27, 2026
3 checks passed
@justcarlson
justcarlson deleted the fix/batch-storage-reads branch January 27, 2026 20:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant