Skip to content

Properly handle soft-deleted rows - #522

Merged
nilmerg merged 8 commits into
mainfrom
feature/properly-handle-soft-deleted-rows
Aug 11, 2026
Merged

nilmerg merged 8 commits into
mainfrom
feature/properly-handle-soft-deleted-rows

Conversation

@nilmerg

@nilmerg nilmerg commented Jul 23, 2026

Copy link
Copy Markdown
Member

This introduces a proper way to hide deleted entities automatically. The previous work-around only affected a query's base table and thus didn't restrict joins the same way. Now, joins are covered as well, as are any sub-queries made by the ORM. And that is the only behavior related change: Queries made by ipl-sql are not automatically filtered anymore.

Related changes are introduced as well:

  • Added LEFT join types to relations that were always meant to have it
  • Introduced various guards when accessing relation properties as now they may be NULL

requires Icinga/ipl-orm#165

@nilmerg nilmerg self-assigned this Jul 23, 2026
@cla-bot cla-bot Bot added the cla/signed CLA is signed by all contributors of a PR label Jul 23, 2026
@nilmerg
nilmerg force-pushed the feature/properly-handle-soft-deleted-rows branch from a762b09 to b674c6c Compare July 24, 2026 14:51
@nilmerg
nilmerg force-pushed the feature/properly-handle-soft-deleted-rows branch from b674c6c to 2a57161 Compare July 27, 2026 13:20
@nilmerg
nilmerg force-pushed the feature/properly-handle-soft-deleted-rows branch 2 times, most recently from 131df5b to 1025658 Compare July 27, 2026 13:55
@nilmerg
nilmerg force-pushed the feature/properly-handle-soft-deleted-rows branch from 1025658 to f633892 Compare July 27, 2026 14:17
@nilmerg
nilmerg force-pushed the feature/properly-handle-soft-deleted-rows branch from f633892 to eb12c73 Compare July 28, 2026 11:08
Base automatically changed from feature/duplicate-configuration-158 to main July 29, 2026 09:06
@nilmerg
nilmerg force-pushed the feature/properly-handle-soft-deleted-rows branch 3 times, most recently from 8d02488 to 1fd8ab1 Compare August 4, 2026 09:55
@nilmerg
nilmerg marked this pull request as ready for review August 4, 2026 09:56

@BastianLedererIcinga BastianLedererIcinga left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apart from the deprecation warning everything worked fine while testing and the changes look good.

Comment thread library/Notifications/Model/Source.php
@nilmerg
nilmerg force-pushed the feature/properly-handle-soft-deleted-rows branch from 1fd8ab1 to e28da7f Compare August 5, 2026 09:56
@nilmerg
nilmerg force-pushed the feature/properly-handle-soft-deleted-rows branch 2 times, most recently from d6b0fc3 to 039bf40 Compare August 6, 2026 11:28
@nilmerg

nilmerg commented Aug 6, 2026

Copy link
Copy Markdown
Member Author

the latest two commits contain new changes

They now expect the ORM to restrict access to deleted
rows automatically and bypass this restriction by
issuing raw sql queries to verify successful deletions.
- all models now use a visibility filter to limit access to non-deleted rows
- all queries made implicitly rely on this and don't filter explicitly
Also drops some invalid cases, as only contacts can manage/subscribe.
@nilmerg
nilmerg merged commit 370e4d8 into main Aug 11, 2026
25 checks passed
@nilmerg
nilmerg deleted the feature/properly-handle-soft-deleted-rows branch August 11, 2026 14:28
@github-project-automation github-project-automation Bot moved this from In progress to Done in Icinga Notifications 1.0 Aug 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla/signed CLA is signed by all contributors of a PR

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants