• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

rm-hull / maps / 22363793926
37%

Build:
DEFAULT BRANCH: main
Ran 24 Feb 2026 06:09PM UTC
Jobs 1
Files 87
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

24 Feb 2026 06:08PM UTC coverage: 37.604% (-0.5%) from 38.061%
22363793926

push

github

web-flow
refactor: fetch crime data using latest available date (#1055)

* refactor: fetch crime data using latest available date

Replaces hardcoded date strings with a dynamic lookup of the latest
available crime data from the API. This ensures the map always defaults
to the most recent dataset provided by the source.

*   Added `useLastUpdated` hook to retrieve the latest data timestamp.
*   Updated `StreetLevelCrimeLayer` to initialize the month filter based
    on the API response.
*   Refactored `Legend` to dynamically generate a 12-month selection
    range relative to the latest data point.
*   Added an `enabled` flag to the crime query to prevent unnecessary
    requests before the date is known.

```mermaid
sequenceDiagram
    participant L as StreetLevelCrimeLayer
    participant U as useLastUpdated
    participant Q as useStreetLevelCrimes
    participant S as API Service

    L->>U: Request latest data date
    U->>S: GET /crime-last-updated
    S-->>U: Return latest month (e.g. "2024-11")
    U-->>L: Update state with date
    L->>Q: Trigger query for latest month
    Q->>S: GET /crimes-street?date=2024-11
    S-->>Q: Return crime incidents
    Q-->>L: Render markers
```

* fix: preserve crime month state on update

Ensure the street-level crime month is only initialized with the
`lastUpdated` value if no month is currently selected. This prevents
losing the current filter state when the metadata timestamp changes.

* fix: allow rendering street crime layer without data

The `StreetLevelCrimeLayer` previously returned `null` if `data` was
missing. This change allows the component to continue rendering as long
as `lastUpdated` is valid, preventing the layer from unmounting
prematurely when data is empty or loading.

462 of 1152 branches covered (40.1%)

Branch coverage included in aggregate %.

0 of 25 new or added lines in 3 files covered. (0.0%)

3 existing lines in 1 file now uncovered.

445 of 1260 relevant lines covered (35.32%)

4.09 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
2
0.0
0.0% src/hooks/useStreetLevelCrimes.ts
3
0.0
0.0% src/services/streetLevelCrimes/index.ts
20
0.0
0.0% src/components/map/layers/custom/StreetLevelCrimeLayer.tsx

Uncovered Existing Lines

Lines Coverage ∆ File
3
0.0
0.0% src/components/map/layers/custom/StreetLevelCrimeLayer.tsx
Jobs
ID Job ID Ran Files Coverage
1 22363793926.1 24 Feb 2026 06:09PM UTC 87
37.6
GitHub Action Run
Source Files on build 22363793926
  • Tree
  • List 87
  • Changed 3
  • Source Changed 3
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #22363793926
  • b2a08c1a on github
  • Prev Build on main (#22363363991)
  • Next Build on main (#22363836554)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc