Skip to content

fix: preserve concurrent application document and address updates - #1824

Draft
Jacky-Pham wants to merge 2 commits into
Jacky/strr-component-verification-20260915from
Jacky/strr-application-concurrent-writes-20260915
Draft

Jacky-Pham wants to merge 2 commits into
Jacky/strr-component-verification-20260915from
Jacky/strr-application-concurrent-writes-20260915

Conversation

@Jacky-Pham

@Jacky-Pham Jacky-Pham commented Sep 15, 2026

Copy link
Copy Markdown
Collaborator

Two requests can load the same application JSON and then overwrite each other’s document or address changes. A later upload can revert a saved address, and an address save or second upload can remove an already saved document from the application’s document list.

Refresh the application JSON under a PostgreSQL row lock immediately before each document/address read-modify-write. The existing save commits and releases the lock. Address event history also reads the latest previous address. The upload route finishes remote file storage before acquiring this lock.

Validation: 12 new PostgreSQL tests use independent Flask/ORM sessions and real commits. They cover both upload/address orders, two uploads and two partial-address edits, with sequential controls, overlapping initial reads and a held in-flight write. Fresh reads verify persisted fields and event history; pending-writer cases observe PostgreSQL blocking directly. Eight cases fail on the review base; all four sequential controls pass. All 12 pass after the repair. Dedicated Python 3.12 CI passes 581 API tests with six existing skips. Standard PR CI passes the same tests, coverage and build; all seven PR checks pass. isort and black pass. Pylint still reports the same 39 existing findings with none introduced; the workflow ignores these failures. Combined CI passes 584 API tests with five existing skips, including all 12 new cases, plus the batch job (24), batch listener (54) and backfiller (47).

Stacked on #1799 for the previously verified Docker base repair. The review diff contains only the service change and regression tests. Database fixtures are synthetic and confined to disposable CI PostgreSQL. The dedicated Python 3.12 QA workflow is separate from this review branch. Approval/linking transitions during upload remain outside this regression’s coverage.

@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant