Fix queries to conditionally include IsActiveEntity for non-draft entities - #568
Merged
Merged
Conversation
akgarg06
reviewed
Aug 13, 2026
PujaDeshmukh17
had a problem deploying
to
pr-analysis
August 13, 2026 05:31 — with
GitHub Actions
Failure
PujaDeshmukh17
had a problem deploying
to
pr-analysis
August 13, 2026 05:35 — with
GitHub Actions
Failure
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.
Describe your changes
Updated DBQuery.java to conditionally include the IsActiveEntity column in CQL queries only when the field is present on the attachment entity, preventing runtime errors for non-draft entities that don't have this field.
Added unit tests to DBQueryTest.java covering both the IsActiveEntity-present and IsActiveEntity-absent paths for all three affected query methods.
Problem
Queries in getAttachmentsForUPID, getAttachmentsForUPIDAndRepository, and getAttachmentsForFolder unconditionally selected IsActiveEntity as a column. For entities that are not draft-enabled (i.e., do not have an IsActiveEntity element in their model), this caused an "element does not exist" error at runtime.
Changes
getAttachmentsForUPID — Checks attachmentEntity.findElement("IsActiveEntity").isPresent() before including IsActiveEntity in the column list.
getAttachmentsForUPIDAndRepository — Same conditional check applied.
getAttachmentsForFolder — Both the draft table query and the active entity fallback query now independently check for IsActiveEntity presence before including it (draftHasIsActiveEntity / activeHasIsActiveEntity).
Any documentation
Type of change
Please delete options that are not relevant.
Checklist before requesting a review
Upload Screenshots/lists of the scenarios tested