You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Editing a finding in a stale browser tab overwrites another tab's changes to fields the user did not edit #3736
A stale finding edit submits a full old record, so changing only the title in one tab silently overwrites a newer description saved in another tab.
Steps/Code to Reproduce
Open the same finding's edit dialog in two tabs. In tab 1 change only description to ROUND6 TAB 1 IMPORTANT NEW DESCRIPTION and save. In stale tab 0 change only title to ROUND6 TAB 0 TITLE ONLY EDIT and save. Read the finding through the API.
Additional reproduction details
Run the UI/backend locally with an in-memory database; create a synthetic operation/finding and open its Edit dialog in two tabs before saving. Tab 1 changes only Description to ROUND6 TAB 1 IMPORTANT NEW DESCRIPTION and saves; stale tab 0 changes only Title to ROUND6 TAB 0 TITLE ONLY EDIT and saves. The API then shows the title edit but description reverted to Local fixture for editing and deletion recovery. No real user data or external service is involved.
Expected Results
A title-only edit must preserve the newer description, or report a stale-write conflict without discarding either draft.
Actual Results
After the second save, title changed but description reverted to Local fixture for editing and deletion recovery. API responses prove the persisted description was lost with no conflict message.
Proposed fix/regression: send changed fields only and add optimistic concurrency for same-field conflicts. Test two-tab title/description edits and same-field conflict preservation.
Screenshots
The screenshot is a local evidence artifact, not attached here.
Versions
Tested commit d3446e0, PyRIT 1.2.0.dev0, offline browser with real local APIs. Evidence: files/evidence/round6/concurrent-finding-after-tab0.json and concurrent-finding-overwritten.png; local paths are not attachments.
Confirmed on current main: OperationDetailPage.save sends the whole draft through updateFinding, and the memory layer validates it as a full FindingCreate and writes every column (memory_interface.py, the update(FindingEntry)...values(**validated.model_dump(...)) call). A stale tab therefore overwrites fields it never touched.
Proposal for a first PR: add a PATCH endpoint whose body has every field optional and which applies only the fields that are set. The frontend would send just the fields that differ from the finding it loaded. PUT stays as it is for compatibility. Detecting a same-field conflict (a version or updated_at check that returns 409) needs a schema change, so I would leave it for a second PR. Does that split work for you?
This comment was prepared with AI assistance (Claude Code).
Still reproduces on current main. The whole chain is full-record replace with no staleness check: FindingDialog sends the entire draft, updateFinding PUTs every field, FindingUpdateRequest inherits FindingCreate with no version precondition (pyrit/backend/models/operations.py L108), and FindingEntry.set_fields overwrites every editable column unconditionally (memory_models.py L390-399). The 409 added in #4111 only covers parent-move cycles, not stale writes. A fix should follow the optimistic-concurrency pattern we already use for scenario presets/suites (api.ts L899): add a version or updated_at to FindingEntry, require it on update, 409 on mismatch — plus a regression test for the two-tab title/description scenario.
Activity
pcbeingused33 commentedon Nov 2, 2026
Confirmed on current main:
OperationDetailPage.savesends the whole draft throughupdateFinding, and the memory layer validates it as a fullFindingCreateand writes every column (memory_interface.py, theupdate(FindingEntry)...values(**validated.model_dump(...))call). A stale tab therefore overwrites fields it never touched.Proposal for a first PR: add a PATCH endpoint whose body has every field optional and which applies only the fields that are set. The frontend would send just the fields that differ from the finding it loaded. PUT stays as it is for compatibility. Detecting a same-field conflict (a version or
updated_atcheck that returns 409) needs a schema change, so I would leave it for a second PR. Does that split work for you?This comment was prepared with AI assistance (Claude Code).
its-amann commentedon Nov 6, 2026
Hi! I'd like to work on this. Roman Lutz (@romanlutz), could you assign it to me? I'll follow up with a PR that includes a fix and tests.
Noting @pcbeingused333 offered on Nov 2 with no PR since then, so I'd like to take it if still open.
romanlutz commentedon Nov 19, 2026
Still reproduces on current
main. The whole chain is full-record replace with no staleness check:FindingDialogsends the entire draft,updateFindingPUTs every field,FindingUpdateRequestinheritsFindingCreatewith no version precondition (pyrit/backend/models/operations.pyL108), andFindingEntry.set_fieldsoverwrites every editable column unconditionally (memory_models.pyL390-399). The 409 added in #4111 only covers parent-move cycles, not stale writes. A fix should follow the optimistic-concurrency pattern we already use for scenario presets/suites (api.tsL899): add a version orupdated_attoFindingEntry, require it on update, 409 on mismatch — plus a regression test for the two-tab title/description scenario.its-amann commentedon Nov 25, 2026
Opened a fix for this in #4640, would appreciate a look when you get a chance Roman Lutz (@romanlutz)