-
Notifications
You must be signed in to change notification settings - Fork 110
Open
Description
Ticket: Fix Missing Session Usage in Review Object Approval
Description
The approveReviewOrgObject method in src/repositories/reviewObjectRepository.js accepts an options object (which typically contains the Mongoose transaction session) but fails to pass it to the baseOrgRepository.findOneByUUID call.
This causes the organization lookup to occur outside of the active transaction. If the transaction eventually fails or aborts, this read was still performed without the transaction's context/isolation, potentially leading to inconsistencies.
Acceptance Criteria / TODOs
Backend Changes (src/repositories/reviewObjectRepository.js)
- Pass options to findOneByUUID:
- Locate the call:
const org = await baseOrgRepository.findOneByUUID(reviewObject.target_object_uuid) - Update it to pass
options:const org = await baseOrgRepository.findOneByUUID(reviewObject.target_object_uuid, options)
- Locate the call:
Testing
- Code Review / Static Analysis:
- Verify that all database calls within approveReviewOrgObject now receive the
optionsobject.
- Verify that all database calls within approveReviewOrgObject now receive the
- Transaction Test (Optional/Advanced):
- While difficult to unit test specifically for race conditions, verify that the flow still completes successfully with the session passed.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
Needs Triage
Status
In Review