Skip to content

v1.8.1 - failure paths that no longer fail quietly

Choose a tag to compare

@maschine34675 maschine34675 released this 22 Aug 15:20
· 30 commits to main since this release

Nothing changes for players - this release is for the mods that use the library.

A patch release: every change fixes a failure path, so normal use looks exactly as it did in 1.8.0. Mods on 1.8.0 should move up, as two of the fixes restore promises the API documentation makes.

What players might notice

  • A mod's settings could still be lost after a page reload, in the one case 1.8.0 did not cover - when a page the mod asked for was refused by the browser.
  • A rare crash when the second browser had to be started more than once.
  • A page that simply is not there - a typo in a file name - now says so in the log instead of leaving the overlay to sit there looking slow.
  • An overlay that has died no longer reports itself as showing a page.

For mod authors

Delivery. Navigate and LoadHtml used to drop the buffered sends and the retained state before the call that turned out to be rejected, so the page that stayed on screen lost the state belonging to it - and the next reload, whether the library's own after a renderer crash or the page calling location.reload(), handed it its defaults while the mod still believed its configuration was up. A refused navigation now leaves the overlay exactly as it was. A successful retarget still forgets, as documented.

A page named before the browser exists is navigated to once the view is created, and that attempt could be refused too. Its result was never looked at, so the refused page stayed the overlay's target: every send buffered into nothing, IsPageLoaded stayed false for good, and the mod's next LoadHtml looked like a retarget away from it and threw out state that had never belonged to any page.

Answers. EventDispatch.Manual could swallow one. Results travelled the event queue, and that queue is dropped when the handle is disposed: correct for events, which are documented as droppable, and a broken promise for an answer, which is documented as always arriving. Answers now have a queue of their own - never dropped on overflow, drained first by PumpEvents(), and handed over on the spot when the handle is disposed, since nobody pumps a handle they have thrown away.

Failures stop being silent. A navigation that fails outright now logs the page and the browser's error status. fail() retires the page instead of leaving IsPageLoaded true, answers every script caller still waiting, and refuses later sends rather than buffering them into a page that no longer exists. A renderer crash settles the scripts that were running in it, and a reload the browser refuses afterwards ends the overlay with RendererCrashed instead of leaving it quietly blank.

Also: a Create and a Dispose posted in that order could arrive the other way round and build a window nothing would ever destroy; a second browser that can never start was retried by every windowed overlay, each time holding the creation queue for the full timeout (now at most three attempts, and a ten-second wait rather than thirty); and the documentation for the latched Ready/Failed claimed a late subscription runs inside the +=, which is not true outside the default dispatch mode - it matters to a soft-dependency gate deciding whether to fall back.

Verification

Fault matrix rows 40-45 added, 36 probe modes green, including the pixel and click checks. Verified in game: renderer crash with recovery and the terminal third failure, the browser process killed outright, two mods colliding over hosting modes, and the cursor being handed back mid-raid.

The probe host itself now lives in the repository at tools/Probe, along with preview - a mode that shows your page in a real overlay so a HUD can be built without launching a raid. docs/SOFT-DEPENDENCY.md collects the rules for depending on this library without requiring it.

Installation

Extract Anvil-WebOverlay-v1.8.1.zip over the SPT folder. The demo plugin is optional and separate.