v-ko / real-time-tab-sync

A Chrome extension to automatically synchronize your tabs across devices and sessions.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

QUOTA_BYTES_PER_ITEM quota exceeded

edjroot opened this issue · comments

Hey, thanks for developing this extension!

I'm trying to sync a few hundred tabs between two computers. Probably for this reason, the extension isn't working. This is what I get right after installing it and checking the background page log (there were more lines, but I believe this is the only relevant part):

Unchecked runtime.lastError while running storage.set: QUOTA_BYTES_PER_ITEM quota exceeded
    at background.js:563:41
    at Object.callback (background.js:647:57)

[updateStorageFromTabs_directly] tabs saved to sync.

From the last line, I'd say the extension is just ignoring the error. The same lines periodically reappear on the console, so I guess it's retrying and failing without handling the problem.

Thanks for the feedback. The extension uses the Chrome API to synchronize your tabs (as in: I have no server, Googles servers sync your tabs) , and that API has a restriction on the traffic each user can generate (so that nobody exploits Googles servers unreasonably much) . In short: I'm sorry to say it but the only thing I can do is to catch the warning and explain to the user why the extension is failing through a notification/warning. The amount of tabs you have is apparently too big for the Chrome API and the only way to fix it would be to make a dedicated server to handle the traffic (and not use Chrome API) which I can't.

Yes, my main purpose with opening this issue was to let you know that the extension isn't catching the error. However, I don't think we're thinking about the same kind of problem. The limit you refer to would probably result in a QUOTA_BYTES error, which is the total amount of data that can be synchronized. The error I'm getting is QUOTA_BYTES_PER_ITEM, which is "the maximum size of each individual item" (if I'm not mistaken, each item is a key-value pair). I haven't looked at the extension's code yet, but I'm guessing that it currently stores all tabs in a single item (or something like that). In this case, the solution may be to just structure data differently (e.g. one tab per item).

I underestimated your understanding of the Chrome API and I lazily generalized both QUOTA_BYTES and QUOTA_BYTES_PER_ITEM as "traffic limitation". Yes, the size of the data object containing all the tabs' URLs can be reduced by storing the data differently (or by using compression for example), but it's non-trivial IMO. If it's one tab per item I think the write operations per hour quota would be easily hit. It's quite possible to make an algorithm that optimizes the data structures and transfers, but as I don't have much time to devote to the extension and the case is fairly uncommon (using that many tabs) - I can't promise I'll get to these optimizations any time soon. If you want to make the change yourself I'll be happy to review and merge it.

Oh, I had forgotten about the hourly quota. You're right, the solution may not be that simple. I guess this issue is really just an edge case, so no worries about it. I'm also pretty busy, but I'll see if I can try to tackle this sometime in the future.

Thanks again!