Consider atomic JSON writes
Maintainers usually reply within 3 days
@ashiishe2-oss is already working on this.
Since Nov 7, 2026.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 70/100
Research direction
Find the code that writes Thing settings and read how it currently serializes and saves the JSON file. Then check the project’s existing tests for settings persistence and add coverage for interrupted or atomic writes. Done means a settings update uses a temporary file and replacement so the settings file remains valid if writing is interrupted.
Written by the indexing model from the issue text.
Description
Describe the bug
If LabThings is interrupted while writing Thing settings, the file could get corrupted.
To Reproduce
Pull the power during a settings update.
Expected behaviour
It would be nice if the file didn't get corrupted.
Additional context
This should be easy enough to avoid by writing to a temp file, then swapping the temp file with the actual settings file. That reduces to nearly-zero the time during which the file could be broken.
- Dominant language
- Python
- Stars
- 10
- Forks
- 4
- Avg merge
- 4d 15h
- Merged PRs (30d)
- 11
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from labthings/labthings-fastapi
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
labthings/labthings-fastapi#438 ·
Maintainers usually reply within 3 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
labthings/labthings-fastapi#435 ·
Maintainers usually reply within 3 days
-
drop-python-version
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
labthings/labthings-fastapi#354 · 2 comments ·
Maintainers usually reply within 3 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
labthings/labthings-fastapi#312 · 1 comment ·
Maintainers usually reply within 3 days
-
good first issue help wanted low priority
Difficulty 3/5 1-2 days Newbie friendliness 65/100
labthings/labthings-fastapi#437 ·
Maintainers usually reply within 3 days
All issues in labthings/labthings-fastapi
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
plone/plone.observability#114 ·
Maintainers usually reply within 1 day
-
area:docs type:docs
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
jejjohnson/gauss_flows#246 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
openvax/varcode#824 · 1 comment ·
Maintainers usually reply within 1 day
-
netbox status: needs triage type: feature
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
netbox-community/netbox#23868 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
emeryberger/CSrankings#15757 ·
Maintainers usually reply within 9 days