learningequality / learningequality/studio
Simultaneous writes to JSON fields could stomp prior changes
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 191
- Forks
- 307
- Avg merge
- 5d 6h
- Merged PRs (30d)
- 10
Description
Summary
At the moment we use a DB read and then Python land updating to do partial updates to JSON fields - in the case of concurrent edits, this could cause stomping of other's changes.
We could prevent this by using the JSONField implementation from django-postgres-extensions and the associated JSONBSet function - this would allow us to do specific updates directly in the database, and reduce the risk of change stomping.
Contributor 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.
Research direction
The issue names no files, tests, or entry points. Start by locating the Python JSONField partial-update path and reviewing the linked django-postgres-extensions JSONField and JSONBSet documentation. Done means concurrent updates to separate JSON paths no longer overwrite each other, with regression coverage for that case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- postgresql, python
- Domain
- backend, databases
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100