Skip to content

Resolves issue #1663, Resolve inconsistent parameters and query target UUID when fetching review history conversations.#1815

Merged
david-rocca merged 2 commits into
devfrom
dr_1663
May 21, 2026
Merged

Resolves issue #1663, Resolve inconsistent parameters and query target UUID when fetching review history conversations.#1815
david-rocca merged 2 commits into
devfrom
dr_1663

Conversation

@jdaigneau5
Copy link
Copy Markdown
Collaborator

@jdaigneau5 jdaigneau5 commented May 20, 2026

Closes Issue #1663

Summary

Resolves a bug where fetching the review history for an organization with conversations included (include_conversations=true) fails. The codebase had inconsistent parameters in getAllByTargetUUID inside reviewObjectRepository.js and was querying using the review object UUID instead of the organization's target UUID. Additionally, the conversation repository has been hardened to prevent paginator options (like lean: true) from leaking into the find() query, which previously caused a TypeError and hung the request.

Important Changes

src/repositories/reviewObjectRepository.js

  • Fixed getReviewHistoryByOrgShortNamePaginated to retrieve conversations using review.target_object_uuid instead of review.uuid.
  • Removed passing pagination options into getAllByTargetUUID to prevent pollution of conversation queries.

src/repositories/conversationRepository.js

  • Hardened getAllByTargetUUID to filter incoming query options, extracting only Mongoose transaction session and ignoring pagination options like lean or page that disrupt .toObject() serialization.

test/integration-tests/review-object/reviewObjectTest.js

  • Enhanced the "Retrieves review history with conversations included" integration test to post a public conversation to the test organization, fetch the history with include_conversations=true, and assert the comment body matches correctly.

Testing

Steps to manually test updated functionality, if possible

  • 1) Run the integration tests using bash -i -c "npm run test:integration".
  • 2) Verify that the test "Retrieves review history with conversations included" under "Review Object Controller Integration Tests" passes.

Notes

  • All 399 integration tests have been run and passed successfully in 39 seconds, introducing zero regressions.

@david-rocca david-rocca changed the title resolve issue #1663, inconsistant calls of getAllByTargetUUID Resolves issue #1663, Resolve inconsistent parameters and query target UUID when fetching review history conversations. May 20, 2026
@david-rocca david-rocca merged commit b9a58d9 into dev May 21, 2026
8 checks passed
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.

3 participants