Skip to content

Geofence feed caches Koji indefinitely, with no way to refresh it but a restart #844

Description

@hokiepokedad2

What happens

/api/geofence-feed serves Koji's PoracleJS project unioned with the fences users have drawn here. The Koji half is cached in memory and never re-read, so a fence created in Koji after this process started is invisible to the feed for as long as the container runs.

On 2026-08-27 this instance had been up 5 days and was serving an 834-entry list. Two fences, New City and Congers, had been created in Koji in project 5 and were being served correctly by Koji's own API. The feed listed neither. Restarting the container took it to 836 with both present.

Why it matters downstream

PogoAlerts provisions coverage areas by writing a fence into Koji, then telling PoracleNG to reload. PoracleNG reads this feed, so a reload against a stale feed re-reads the stale list and answers {"status":"ok"}. The provisioning run reports success and the area is unsubscribable — the two above were built, scanned, and absent from the picker at the same time.

There is no way to fix it from outside. Every path on :8082 answers the SPA catch-all, so there is nothing to POST to. A restart is the only remedy, and nothing tells an operator that one is needed.

What would fix it

An authenticated endpoint that drops the cached Koji collection so the next feed read re-fetches:

POST /api/geofence-feed/refresh
X-Poracle-Secret: <shared secret>
  • 2xx once the cache is dropped. Rebuilding on the next read is fine — the caller retries.
  • 401/403 on a bad secret.

The user-drawn half needs no endpoint; PoracleWeb owns those writes and can invalidate on write.

A TTL would be the lazier option and is worse here: the caller waits an unknown time and still cannot assert the area is pickable. Explicit invalidation lets it confirm.

Client side is already written

PogoAlerts calls this endpoint before reading the feed as of PGAN-Dev/pgan-web#345. It treats 404/405 as "this build has no refresh endpoint" and tells the admin a restart is required, so deploying that side early is harmless — it starts working when this lands.

The header name and path above are what it sends. Happy to change either if you would rather they were different; say so before this ships and I will match it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions