You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR bumps the extension/package version to 1.1.6 and reduces noisy logging by routing several storage-related console.log calls through debugLog().
Main concern: src/common/storage.ts now imports src/content/debugLog.ts, which is a content-script-oriented module that installs a chrome.storage.onChanged listener and itself imports _getStorageAsync from storage.ts. That cross-context dependency can lead to unexpected background/options behavior and introduces a circular dependency risk.
Confidence Score: 4/5
Mostly safe, but there is a real risk of cross-context/circular dependency issues due to importing a content-script debug module into shared storage code.
Version bumps are straightforward, and the logging cleanup is low-impact. The main risk is architectural: src/common/storage.ts now depends on src/content/debugLog.ts, which installs listeners and imports storage again, creating an unnecessary coupling that can break builds or produce unexpected side effects in non-content contexts.
src/common/storage.ts
Important Files Changed
Filename
Overview
manifest.json
Bumped extension version from 1.1.5 to 1.1.6.
package.json
Bumped npm package version from 1.1.5 to 1.1.6.
src/common/storage.ts
Replaced several console.log calls with debugLog; however storage.ts now imports a content-script debug module, which can cause cross-context bundling/circular-dependency issues.
Sequence Diagram
sequenceDiagram
participant Any as Background/Options/etc
participant Storage as src/common/storage.ts
participant Debug as src/content/debugLog.ts
participant Local as chrome.storage.local
participant Sync as chrome.storage.sync
Any->>Storage: _getStorageAsync()
Storage->>Local: get(metadata + keys)
alt found in local
Storage-->>Any: TabModifierSettings
else not found
Storage->>Debug: debugLog("No data... checking sync")
Storage->>Sync: get(metadata + keys)
alt found in sync
Storage->>Debug: debugLog("Migrating...")
Storage->>Storage: _setStorage(data)
Storage->>Debug: debugLog("Saving...")
Storage->>Local: set(STORAGE_KEY_COMPRESSED)
Storage->>Sync: remove(migration keys)
Storage-->>Any: TabModifierSettings
else not found
Storage-->>Any: undefined
end
end
Note over Debug: initDebugMode() installs onChanged listener
Debug->>Local: onChanged listener triggers
Debug->>Storage: _getStorageAsync() (reload settings)
src/common/storage.ts Cross-context debug import src/common/storage.ts is shared code (used by background/options/etc), but it now imports ../content/debugLog.ts (storage.ts:5). That file registers a chrome.storage.onChanged listener and is content-script-specific by its own header comment; bundling this into non-content contexts can cause build/runtime issues (or at least unexpected listeners in background/options) and also creates a dependency cycle risk (debugLog.ts imports _getStorageAsync from storage). Consider moving the logging helper to a context-agnostic module (no listeners) or keep storage.ts using a plain logger and let content scripts wrap it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.