diff --git a/src/config.ts b/src/config.ts index 5a0fe5be..41a14303 100644 --- a/src/config.ts +++ b/src/config.ts @@ -370,8 +370,20 @@ function configProxy(): { sync: SBConfig, local: SBStorage } { } function forceSyncUpdate(prop: string): void { + const value = Config.cachedSyncConfig[prop]; + if (prop === "unsubmittedSegments") { + // Early to be safe + if (JSON.stringify(value).length + prop.length > 8000) { + for (const key in value) { + if (!value[key] || value[key].length <= 0) { + delete value[key]; + } + } + } + } + chrome.storage.sync.set({ - [prop]: Config.cachedSyncConfig[prop] + [prop]: value }); }