Resolves issue #1784 , Fixes false positives in joint approval change detection due to Date vs String comparison.#1793
Merged
david-rocca merged 3 commits intoupdated_ur_fieldsfrom May 1, 2026
Merged
Conversation
cberger8
approved these changes
May 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes Issue #1784
Summary
This PR addresses an issue where
hasJointApprovalChangeswas incorrectly evaluating totruewhen submitting a complete BaseOrg document update even if no actual joint approval fields were modified. This was caused by comparing MongooseDateobjects against ISO date strings (e.g.,tl_root_start_date), which lodash's_.isEqualevaluated as strictlyfalse. This fix rectifies the logic by converting the compared data objects into primitive JSON representations prior to executing lodash deep equality checks.Important Changes
src/repositories/baseOrgRepository.jsgetJointApprovalFieldsto convert the original and updated document subsets to stringified JSON formats before running the_.isEqualstrict equality check.updateOrgFullto perform the sameJSON.parse(JSON.stringify(...))conversion when checking for changes viaincomingJointApprovalKeys, successfully preventing an erroneoushasJointApprovalChanges = trueflag.Testing
Steps to manually test updated functionality, if possible
npm run test:integrationto ensure all existing organization update behaviors remain functional and pass.PUTrequest to update an organization using a full BaseOrg JSON payload containingtl_root_start_date, ensuring the date value is unchanged.hasJointApprovalChangescorrectly evaluated tofalse.Notes
JSON.parse(JSON.stringify(...))safely handles the conversion of nativeDateobjects to their API-compliant ISO string representations, and safely dropsundefinedvalues to treat missing keys consistently.