SetPageOptions saved without starting the host again for any package whose
page and panels looked like all it had. Window() only reads main/exports,
so a package with magpie.hooks and a page (magpie-community/plugins#117's
PowerContext) counted as page-only. The host hands each hook the options it
loaded with, so a Service URL or key saved from the page did nothing until
magpie restarted. A gateway hook now goes through SetOptions, as a
middleware and an agent already did.
Run at d2e0ea393 plus this change:
- TestGatewayHookSeesOptionsSavedFromItsPage: red on the old page.go
("tag=first after the page saved, want second"), green with the fix.
- go test -tags nogui ./internal/plugin: ok (118s).
- go test -tags nogui -run 'TestAsyncGateway|TestGatewayHook' ./internal/gateway: ok.
- go test -tags nogui -run 'Page|Plugin' ./internal/gui: ok.
- GOOS=linux and GOOS=windows go vet of internal/plugin and internal/gateway; gofmt -l clean.
- The real PowerContext package (PR head 3a6aa8f rebased on plugins main)
in the real Bun host behind New().Handler(): before the fix a page save
sent nothing to the new server; after it, the next request resolved,
prepared and hinted against the new server with the new key.
Not run: the full go test ./... (machine at load ~340).