POST /reload can return null instead of GeoJSON

Open Beginner friendly
#30 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Quiet
Tech stack
python
Domain
api, backend

Research direction

Start at web/app.py:257 and trace POST /reload through reload_data()'s empty-features branch and the cache calls. Verify the fresh-deployment case where FIRMS returns zero detections, and ensure the endpoint returns a GeoJSON FeatureCollection rather than null.

Written by the indexing model from the issue text.

Description

bug

File: web/app.py:257

POST /reload returns JSONResponse(cache.get_current()) without checking for None.

Failure scenario: On a fresh deployment where Valkey has never been populated and FIRMS returns zero detections, reload_data()'s empty-features branch never calls cache.set_current(), so get_current() is still None. The route returns HTTP 200 with a literal null body instead of a GeoJSON FeatureCollection, breaking any caller (including a scheduled mise run reload) expecting GeoJSON.

Category: correctness

Dominant language
Python
Stars
5
Forks
1
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from kjaymiller/fire-map

All issues in kjaymiller/fire-map

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.