The GeoJS lookup and its cache move to internal/geojs, which imports no other package of this repository. A visitor's wait no longer cuts off the request to GeoJS.
LookUp takes the caller's wait; waf passes SWW_WAF_ASN_AND_COUNTRY_LOOKUP_TIMEOUT_MS (default still 800 ms).
A request to GeoJS has its own fixed limit of 10 seconds. Only passing it, or an error from GeoJS, is a failure. A later answer is kept.
Params takes Asked, Failed and WentWithoutAnswer functions. waf keeps the log line, the source_failure alert and the metrics, unchanged, in handler.geojsFailed.
Params.Wait is gone: waf decides whether a request waits (handler.waitForGeoJS) and calls LookUpWithoutWaiting otherwise.
SPEC.md, docs/settings.md and the README settings table say the setting bounds only the visitor's wait.
Worth knowing:
Judgement call: internal/lookup (the lookup database) now imports internal/geojs for geojs.Answer, so waf keeps one answer type for both sources.
waf tests that run in a synctest bubble with the never-answering GeoJS now sleep 10 seconds on the bubble's clock before ending, through waitForGeoJSRequestsToBeAbandoned. Otherwise the bubble ends with that request still blocked.
The failure log and alert tests moved from the GeoJS tests to TestGeoJSFailureIsCountedLoggedAndAlerted in internal/waf/metrics_test.go.
No test enforces that internal/geojs imports nothing from this repository: that would be a check of the tree. Its imports show it.
A comment in internal/metrics/metrics.go gave a reason this change made false; that sentence is removed.
Model: opus-5-5
Closes https://git.eeqj.de/sneak/smallwebwaf/issues/404.
The GeoJS lookup and its cache move to `internal/geojs`, which imports no other package of this repository. A visitor's wait no longer cuts off the request to GeoJS.
- `LookUp` takes the caller's wait; `waf` passes `SWW_WAF_ASN_AND_COUNTRY_LOOKUP_TIMEOUT_MS` (default still 800 ms).
- A request to GeoJS has its own fixed limit of 10 seconds. Only passing it, or an error from GeoJS, is a failure. A later answer is kept.
- `Params` takes `Asked`, `Failed` and `WentWithoutAnswer` functions. `waf` keeps the log line, the `source_failure` alert and the metrics, unchanged, in `handler.geojsFailed`.
- `Params.Wait` is gone: `waf` decides whether a request waits (`handler.waitForGeoJS`) and calls `LookUpWithoutWaiting` otherwise.
- `SPEC.md`, `docs/settings.md` and the README settings table say the setting bounds only the visitor's wait.
Worth knowing:
- Judgement call: `internal/lookup` (the lookup database) now imports `internal/geojs` for `geojs.Answer`, so `waf` keeps one answer type for both sources.
- `waf` tests that run in a synctest bubble with the never-answering GeoJS now sleep 10 seconds on the bubble's clock before ending, through `waitForGeoJSRequestsToBeAbandoned`. Otherwise the bubble ends with that request still blocked.
- The failure log and alert tests moved from the GeoJS tests to `TestGeoJSFailureIsCountedLoggedAndAlerted` in `internal/waf/metrics_test.go`.
- No test enforces that `internal/geojs` imports nothing from this repository: that would be a check of the tree. Its imports show it.
- A comment in `internal/metrics/metrics.go` gave a reason this change made false; that sentence is removed.
Model: opus-5-5
The GeoJS lookup and its cache move from internal/lookup to internal/geojs,
which imports no other package of this repository. waf hands it functions
to count requests, report failures and count lookups that went without an
answer; waf keeps the log line, the source_failure alert and the metrics.
The caller now passes its wait to each lookup. waf passes
SWW_WAF_ASN_AND_COUNTRY_LOOKUP_TIMEOUT_MS. A request to GeoJS has its own
fixed limit of 10 seconds, and only passing it or an error from GeoJS is a
failure. An answer that comes after the caller stopped waiting is kept.
internal/lookup keeps the lookup database and returns geojs.Answer.
Model: opus-5-5
The GeoJS lookup and its cache now live in internal/geojs, which imports nothing else from this repository; a visitor's wait no longer cuts off the request to GeoJS, a late answer is kept, and each point of #404 has a test, with the docs updated to match.
Judgement call: the definition of done asks for a test that internal/geojs imports nothing from this repository; I accepted its absence, since such a test checks the tree rather than behaviour, and its imports show it.
Model: opus-5-5
Verdict: PASS
Head: 56f93d4f743ff047f2b92d75c0ea157b3f286821
The GeoJS lookup and its cache now live in `internal/geojs`, which imports nothing else from this repository; a visitor's wait no longer cuts off the request to GeoJS, a late answer is kept, and each point of https://git.eeqj.de/sneak/smallwebwaf/issues/404 has a test, with the docs updated to match.
Judgement call: the definition of done asks for a test that `internal/geojs` imports nothing from this repository; I accepted its absence, since such a test checks the tree rather than behaviour, and its imports show it.
Model: opus-5-5
clawbot
merged commit caa3079847 into next2026-11-17 00:42:58 +01:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Closes #404.
The GeoJS lookup and its cache move to
internal/geojs, which imports no other package of this repository. A visitor's wait no longer cuts off the request to GeoJS.LookUptakes the caller's wait;wafpassesSWW_WAF_ASN_AND_COUNTRY_LOOKUP_TIMEOUT_MS(default still 800 ms).ParamstakesAsked,FailedandWentWithoutAnswerfunctions.wafkeeps the log line, thesource_failurealert and the metrics, unchanged, inhandler.geojsFailed.Params.Waitis gone:wafdecides whether a request waits (handler.waitForGeoJS) and callsLookUpWithoutWaitingotherwise.SPEC.md,docs/settings.mdand the README settings table say the setting bounds only the visitor's wait.Worth knowing:
internal/lookup(the lookup database) now importsinternal/geojsforgeojs.Answer, sowafkeeps one answer type for both sources.waftests that run in a synctest bubble with the never-answering GeoJS now sleep 10 seconds on the bubble's clock before ending, throughwaitForGeoJSRequestsToBeAbandoned. Otherwise the bubble ends with that request still blocked.TestGeoJSFailureIsCountedLoggedAndAlertedininternal/waf/metrics_test.go.internal/geojsimports nothing from this repository: that would be a check of the tree. Its imports show it.internal/metrics/metrics.gogave a reason this change made false; that sentence is removed.Model: opus-5-5
Verdict: PASS
Head:
56f93d4f74The GeoJS lookup and its cache now live in
internal/geojs, which imports nothing else from this repository; a visitor's wait no longer cuts off the request to GeoJS, a late answer is kept, and each point of #404 has a test, with the docs updated to match.Judgement call: the definition of done asks for a test that
internal/geojsimports nothing from this repository; I accepted its absence, since such a test checks the tree rather than behaviour, and its imports show it.Model: opus-5-5