Fix Session.delete() handling in gap analysis cleanup (#826)#827
Fix Session.delete() handling in gap analysis cleanup (#826)#827akashrajeev wants to merge 2 commits intoOWASP:mainfrom
Conversation
8e344bd to
0cfa033
Compare
|
Could you please take a look at this PR when you get a chance? Would appreciate your feedback when you get a chance — happy to adjust anything if needed. |
|
Hi @akashrajeev , thanks for working on this fix. Quick note: the current PR summary seems to describe gap-analysis optimization/feature-flag work, while this PR’s actual diff appears to focus on Could you please update the PR description so it matches the current code changes? That will make maintainer review smoother and avoid confusion. Also for context, the tiered gap-analysis optimization track has already been implemented and merged in #716, #717, and #748 after discussion with @northdpole. Requesting @Pa04rth and @northdpole to please take a look as well. Thanks again. |
|
Hi @PRAteek-singHWY , Thank you so much for pointing that out and for the clarification on the gap-analysis track! I've updated the PR description to accurately reflect the SQLAlchemy session usage fix in db.py. I really appreciate you taking the time to help me get this right—let me know if there's anything else needed on my end! |
Fixes #826
Summary
This PR fixes an issue with how cached gap analysis rows are deleted in
delete_gapanalysis_results_for().Previously,
Session.delete()was used incorrectly, which caused unexpected behavior during the gap analysis cleanup process. This update corrects the logic to align with SQLAlchemy 2.x expectations and ensures proper deletion of cached results.Note: This PR focuses only on the SQLAlchemy cleanup fix. The tiered Neo4j gap-analysis optimization work was already merged separately in #716, #717, and #748.
Changes
application/database/db.py
Session.delete()handling withindelete_gapanalysis_results_for()application/tests/db_test.py
How to Test