Skip to content

merge of data from inside and outside of transaction #1680

@ElectricNroff

Description

@ElectricNroff

const pendingFullState = _.merge({}, org.toObject(), pendingReviewData)

However, org comes from:
const org = await repo.findOneByShortName(shortName)

(i.e., what existed in the database whenever that line of code executed) but pendingReviewData comes from:
const pendingReview = await reviewRepo.getOrgReviewObjectByOrgShortname(shortName, isSecretariat, { session })

(i.e., reading from the transaction snapshot). By retrieving pendingReviewData and the stored BaseOrg document inside the same transaction, one can increase the likelihood that the review data was intended to be applicable to that BaseOrg document.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

In Review

Status

Todo

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions