Call-nature force expiry + system-admin map pin corrections/removal#246
Open
officialbones wants to merge 1 commit into
Conversation
Call natures gain a per-category expireMinutes setting (0 = never).
Incidents whose nature has a force-expire value drop off the live map
that many minutes after dispatch, overriding the viewer's time range.
Disabled categories are inert; blank natures shown as UNKNOWN PROBLEM
expire with the UNKNOWN PROBLEM category. Values are clamped 0-10080
server-side and a since-less /api/incidents request is floored to a
31-day scan window so expiry cannot force a full-history table scan.
System admins (and the admin console) can correct a pin's address,
nature, and location, or remove the plot, from the incident popup.
Corrections use click-to-place on the map and persist with manual/admin
status so they survive the map filter. Backed by PUT/DELETE
/api/incidents/pin/{callId}, gated to system-admin users.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Author
|
In lamience terms
|
This was referenced Jul 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two admin-facing features for the incident map:
1. Call-nature force expiry
Each call-nature category gains a Force expire (minutes) setting (
0= never), edited from Admin Options Incident Mapping Call Natures.UNKNOWN PROBLEM, so a force-expire on the UNKNOWN PROBLEM category also covers them (same equivalence as the existing SuppressUnknownNaturePins toggle)./api/incidentsquery via aNOT EXISTSsubquery oncallNatures.2. System-admin pin corrections & removal
System admins (and the admin console) can correct or remove an incident's map plot directly from the pin popup.
PUT/DELETE /api/incidents/pin/{callId}, gated to system-admin users (or the admin token). Corrections persist withmanual/adminstatus so they survive the map filter and stay distinguishable from geocoded pins.Schema
callNatures.expireMinutes integer NOT NULL DEFAULT 0via an idempotentADD COLUMN IF NOT EXISTSin the existingmigrateCallNaturesstartup migration — no data migration needed, existing installs pick it up automatically.Hardening (from an adversarial self-review)
expireMinutesis clamped server-side to0–10080(7 days) — the API no longer trusts the client's range.since-less/api/incidentsrequest is floored to a 31-day scan window, so a configured expiry cannot turn it into a full-history table scan on large installs.lat [-90, 90],lon [-180, 180], not0,0, both-or-neither).Testing
Verified end-to-end against a local Postgres + server build with seeded data:
callNatures.expireMinutes; the expiryNOT EXISTSpredicate runs cleanly against thecallstable.Pin corrected, sidebar and pin updated, DB row stored asmanual/admin.skipped, lat/lon0).PUT/DELETEreturn 200 for a system-admin session, 403 for a non-admin user, 401 for anonymous.Notes
The built
server/webapp/bundle is intentionally not included it is generated output and is not tracked in the repo.Generated with Claude Code Fable 5