Skip to content

v1.8.2 - answers that know which page asked

Choose a tag to compare

@maschine34675 maschine34675 released this 22 Aug 18:47
· 29 commits to main since this release

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

A patch release from a full external code review of 1.8.1. Every finding was independently verified before it was acted on: all of them real, none of them a release blocker, and three of the review's recommended corrections turned out to be wrong and were not taken.

What players might notice

  • An answer the game was too busy to deliver could be dropped instead of arriving late.
  • A page that reloads no longer receives an answer meant for the page before it.

For mod authors

The theme is identity: a question belongs to the document that asked it, and a navigation completion belongs to the navigation that started it. Neither was tracked, because until now nothing needed them to be.

Requests. A page numbers its questions from 1 again in every new document and matches an answer on that number alone. So a reply the mod took its time over - the deferred OnRequest form, or any reply at all under main-thread dispatch - could resolve whichever question the next document happened to number the same. Replies now carry the generation that asked them, both while the mod holds them and while they wait in the outbox, since an answer to a question asked from a parse-time script can still be buffered when the document changes. The mod-to-page direction was never affected; those ids never restart.

Navigation. A NavigationCompleted arriving before its own navigation has started belongs to the one it replaced. Accepting it marked the page the mod was waiting for as loaded and flushed the outbox into a document already on its way out.

Startup. The channel shim is installed asynchronously, and the browser only promises it is in place once its completion has run. The first navigation now waits for that instead of racing it, so the mod's own first page cannot come up without the window.overlay its first script uses. Only the navigation waits - Ready and the window itself are unchanged, since Ready has never meant "the page is loaded"; PageLoaded does.

Answers under EventDispatch.MainThread could be dropped when the queue filled, exactly as they could under Manual before 1.8.1 closed it there. The queue reported a full queue as delivered and the result path believed it. Answers now bypass that limit - their number is bounded by the calls that asked for them, so they cannot run away.

Smaller, same family: a request that timed out while waiting for the page was still put to it afterwards, running a page handler for an answer nobody was listening for; a closed window buffered sends into an outbox nobody would flush; creating a windowed overlay may wait for a second browser, and that wait pumps messages - so it can run the overlay's own close, which creation now checks for afterwards; and Navigate to the page already showing counted as a retarget and discarded the retained state, while the same page reloading itself kept it.

Documentation. The virtual-host isolation wording was imprecise in all four places it appeared: DENY_CORS denies fetch and XHR from another origin but not ordinary sub-resource loads. The access kind itself is unchanged and deliberate - the stricter DENY would break inline pages, whose opaque origin makes even the mod's own markup cross-origin to the mapped folder. The README's links are now absolute, because it ships inside the release zip where none of its targets do.

Verification

Probe mode generation, fault matrix rows 48-49, full matrix green across 37 modes. The matrix now states how each row is evidenced rather than marking everything PASS, after one row was found to claim a proof the automation does not perform.

Deferred to a separate round, deliberately: the unbounded host queue (not reachable by normal mod code), download policy, the two-process user-data-folder question, headless detection, and the bounds-store lock timeout. Each needs a design decision or a two-process test that the probe cannot stand in for.

Installation

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