Repository navigation
Conversation
Changelog IDOR guard (fetchChangelog scoped lookup, lookupAttachmentScoped helper, DBQuery scoped overload) belongs to a separate branch. This commit restores fetchChangelog to the develop baseline and removes the associated test mocks, leaving only the N+1 fix for processNestedEntityComposition.
Pass Map.of("ID","parent-id") instead of an empty map so the parentId
null-guard added by the N+1 fix does not short-circuit the method before
persistenceService.run() is reached.
akgarg06
had a problem deploying
to
pr-analysis
November 14, 2026 07:25 — with
GitHub Actions
Failure
This branch had an error being deployed
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.
Problem
handleDraftDiscardForLinksis registered as@Before(DRAFT_CANCEL)for all application services globally. It callsrevertNestedEntityLinks→processNestedEntityComposition, which fetched all draft rows across the entire tenant with no parent filter:For each row returned,
revertLinksForCompositionfired an additional DB query — a classic N+1 problem where N is the total number of accumulated draft rows in the tenant. With ~5,000 drafts, this caused 20–26 second delays on everyDRAFT_CANCELacross the entire application.Fix
parentKeysis already extracted from the cancel CQN inhandleDraftDiscardForLinks. It is now threaded throughrevertNestedEntityLinksintoprocessNestedEntityComposition, which adds a parent ID filter so only the cancelled entity's own rows are fetched:Two defensive guards are also added to handle edge cases gracefully:
upIdKeyresolves to null or empty → log debug and skip the nested entityparentIdis null (key name mismatch between entity and CQN) → log warn and skip, preventing a silentWHERE up__ID IS NULLfull-scan fallbackType of change
Please delete options that are not relevant.
Checklist before requesting a review
Upload Screenshots/lists of the scenarios tested