Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Changelog

## 6.13.1

- Fix: on AdGuard, "Restored N visited URLs from the worker" appeared on every page load, and every page downloaded the whole history again. 6.12.0 removed one cause; this fixes the one that remained. AdGuard sends each stored value to its app as a single request, with the value URL-encoded inside it. A value too large for that request is not kept, and the script is not told: the page that saved it still reads it back from its own copy. Once the history grew past a few hundred visits it no longer fit, so it survived no page load at all. Small values, such as the sync settings, were kept, which is why sync kept working and the problem looked like something else.
- Change: a value larger than the device keeps is now stored as parts, each well under the limit, plus a short pointer to them. Parts are cut with 20% headroom, counted the strict way (as if quotes were escaped twice).
- **The pointer is written last, after a short pause.** A page left before then never writes it, and the value before stays whole.
- **Each pointer also names the previous complete version.** If a part of the newest is missing, the previous one is read rather than nothing, and journals and the worker bring it up to date. A history found with parts still arriving, including one read from that previous version, is not written over until it settles.
- **A save made as the page is left writes no parts**, so it leaves no copies behind; the journal and the replay note carry the click to the next page.
- **Cleanup:** each tab removes the part set it replaced, keeping the current and previous ones. Parts nothing refers to are removed two minutes after they were written.
- **Fewer saves:** save requests made while a save is waiting are folded into it, so a burst of clicks costs one or two saves, not one each.
- Add: the script measures how large a value the device keeps. It stores test values of 2, 8, 32 and 128 KB, checks on the next page load which came back, uses the largest, and measures again weekly, keeping the last result meanwhile. Until it knows, it uses parts of about 6 KB. Tabs that start a measurement together share the same keys, and the page that judges it removes them all. The settings panel shows the result, and warns if a stored value was found with parts missing. Managers that report other tabs' writes, such as Tampermonkey, are not measured: they have no such limit.
- The test suites can now run against a manager that drops oversized values (`JVS_VALUE_LIMIT=8000 npm test`). Under that limit, 6.13.0 fails 12 tests; this release passes all 150, in every configuration.
- The worker version moves to 6.13.1 with the userscript; the worker is unchanged.

## 6.13.0

- Add: a live sync status next to the JavStore controls, so you can tell when a sync is still running and wait before opening new tabs. A tab opened during a long sync starts from the history as it was before the sync, and on AdGuard it then downloads the whole history again itself.
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ Once it is deployed, open the `JVS` panel → **Cloud sync**, enter the worker U
- Cloud sync additionally uses `GM_xmlhttpRequest` with `@connect *`, because the worker URL is yours to choose. It is only called once sync is switched on; engines without it fall back to `fetch`, which the worker's CORS headers allow.
- Optional userscript APIs: `GM_addValueChangeListener` and `GM_registerMenuCommand`. AdGuard does not implement either; the script polls for changes instead of being notified, and its own on-page control replaces the manager menu.
- `GM_getValue`/`GM_setValue` are supported in both the synchronous Tampermonkey style and the asynchronous GM4 style AdGuard uses. Values are stored as JSON strings, because GM4 only promises to keep strings, numbers and booleans, and AdGuard for Android drops stored objects when the page reloads.
- AdGuard does not keep a stored value that is too large to fit in the single request it sends to its app, and does not say so. The script measures how large a value the device keeps (the settings panel shows it) and stores anything larger as parts behind a short pointer.
- `GM_listValues` and `GM_deleteValue` let each page keep its own journal of what it recorded, so tabs saving at the same moment cannot overwrite each other's visits. AdGuard and Tampermonkey provide both; an engine without them falls back to a single stored document.
- AdGuard (for Mac, Windows and Android) gives each tab the stored values as they were when the tab loaded, and never shows it what other tabs save afterwards. On managers without `GM_addValueChangeListener`, a tab open for more than eight minutes therefore saves only to its own journal and leaves the shared history to newer tabs, which fold its journal in. Journal keys are each written for five minutes at most and removed only once a newer tab has found them in the saved history, so a long-open tab can neither write an older history over a newer one nor remove another tab's journal. Long-open tabs do not show what other tabs recorded after they loaded until they sync or are reloaded.

Expand Down
Loading
Loading