Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

projections: Trigger changes for leaf node deletions #193

Merged
merged 1 commit into from
Mar 29, 2023

Conversation

the-mikedavis
Copy link
Member

This change fixes a regression introduced with the refactor to the pattern tree to hold projections for a specific case of deletions from the tree tree.

To hit this edge-case, a path must be deleted from the tree with no other sibling tree nodes. In other words, the deletion must not trigger any ancestor tree nodes from being cleaned up by the default keep-while conditions. Also, a projection must be registered to a path pattern which would match this deleted path.

For deletion changes, we look at all of the children of the deleted path to check if child node deletions should trigger any projections. This block mistakenly forgot to also check if the deleted path itself should trigger any projections.

This change fixes a regression introduced with the refactor to the
pattern tree to hold projections for a specific case of deletions from
the tree tree.

To hit this edge-case, a path must be deleted from the tree with no
other sibling tree nodes. In other words, the deletion must not trigger
any ancestor tree nodes from being cleaned up by the default keep-while
conditions. Also, a projection must be registered to a path pattern
which would match this deleted path.

For deletion changes, we look at all of the children of the deleted
path to check if child node deletions should trigger any projections.
This block mistakenly forgot to also check if the deleted path itself
should trigger any projections.
@the-mikedavis the-mikedavis added the bug Something isn't working label Mar 28, 2023
@the-mikedavis the-mikedavis added this to the v0.7.0 milestone Mar 28, 2023
@the-mikedavis the-mikedavis self-assigned this Mar 28, 2023
@codecov
Copy link

codecov bot commented Mar 28, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: -0.03 ⚠️

Comparison is base (ac05a93) 91.07% compared to head (ac76eea) 91.04%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #193      +/-   ##
==========================================
- Coverage   91.07%   91.04%   -0.03%     
==========================================
  Files          21       21              
  Lines        3541     3541              
==========================================
- Hits         3225     3224       -1     
- Misses        316      317       +1     
Flag Coverage Δ
erlang-24 89.52% <100.00%> (-0.09%) ⬇️
erlang-25 89.77% <100.00%> (ø)
erlang-26.0-rc2 88.44% <100.00%> (+0.11%) ⬆️
os-ubuntu-latest 91.04% <100.00%> (-0.03%) ⬇️
os-windows-latest 89.66% <100.00%> (+0.05%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/khepri_machine.erl 95.56% <100.00%> (ø)

... and 1 file with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@dumbbell dumbbell merged commit 6b931db into main Mar 29, 2023
10 checks passed
@dumbbell dumbbell deleted the md-fix-projection-delete branch March 29, 2023 08:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants