Skip to content

Bring parent uuids in correct order#562

Merged
lippserd merged 1 commit intomainfrom
fix-leaf-rule-bug
Apr 25, 2025
Merged

Bring parent uuids in correct order#562
lippserd merged 1 commit intomainfrom
fix-leaf-rule-bug

Conversation

@jrauh01
Copy link
Copy Markdown
Contributor

@jrauh01 jrauh01 commented Jan 10, 2025

The uuid of the nearest parent was checked last but had to be checked first. This resulted in a bug that caused the monitoring rules of the leaf notes to be overwritten by those of the parents.

Fixes #527

@jrauh01 jrauh01 requested a review from lippserd January 10, 2025 13:21
@cla-bot cla-bot bot added the cla/signed label Jan 10, 2025
$parents = $this->listParentUuidsFor($uuid);
$parents[] = $uuid;
$parents = [$uuid];
array_push($parents, ...$this->listParentUuidsFor($uuid));
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

With #572 (PHP 7.4) you can do the following:

$parents = [$uuid, ...$this->listParentUuidsFor($uuid)];

Just for the records, without PHP 7.4, I would've opted for the following:

$parents = $this->listParentUuidsFor($uuid);
array_unshift($parents, $uuid);

@lippserd lippserd added this to the v1.8.0 milestone Apr 25, 2025
@jrauh01 jrauh01 force-pushed the fix-leaf-rule-bug branch from 229fe56 to 2225d04 Compare April 25, 2025 13:00
The uuid of the nearest parent was checked last but had to be checked
first. This resulted in a bug that caused the monitoring rules of the
leaf notes to be overwritten by those of the parents.
@jrauh01 jrauh01 force-pushed the fix-leaf-rule-bug branch from 2225d04 to 8bddc36 Compare April 25, 2025 13:00
@jrauh01 jrauh01 requested a review from lippserd April 25, 2025 13:01
@lippserd lippserd merged commit 2d70eb4 into main Apr 25, 2025
6 of 13 checks passed
@lippserd lippserd deleted the fix-leaf-rule-bug branch April 25, 2025 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Overriding monitoring rules

2 participants