-
Notifications
You must be signed in to change notification settings - Fork 17
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
Automatically reclaim useless tree nodes created automatically #155
Conversation
c3d2256
to
52ecfb8
Compare
Codecov ReportBase: 90.98% // Head: 90.97% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #155 +/- ##
==========================================
- Coverage 90.98% 90.97% -0.02%
==========================================
Files 16 16
Lines 2951 2958 +7
==========================================
+ Hits 2685 2691 +6
- Misses 266 267 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
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 at Codecov. |
52ecfb8
to
c4a1065
Compare
This variable is used for triggers as well, so a more generic name, not something keep_while-conditions-specific, makes more sense.
This makes naming more consistent. Also, this fixes an incorrect set of `#{Watcher => remove}`. It will never match anything and would probably crash. It means the testsuite does not cover this code path...
... instead of `specific_node` or `many_nodes`. This allows to access the value of `include_root_props` without having to add it to `Extra`. Doing this broke the type spec but Dialyzer didn't notice it.
`none` is not a valid value. To specify "return no props", the option should be set to an empty map.
This is the same as `#if_has_data{}` but for any kind of payload. I.e. `#if_has_payload{}` will be true if a tree node hold a stored procedure. `#if_has_data{}` would have been false for that same tree node.
This is the same as `#if_has_data{}` but for stored procedures. We now have a more consistent set of `#if_has_*{}` conditions. Thank you @the-mikedavis for pointing out the issue.
…matically For instance, if a caller stores a value in "/:stock/:wood/oak", both `stock` and `wood` tree nodes are created on the fly, with no payload attached to them. Now, for these automatically created nodes, a "keep while" condition is added so that they are automatically reclaimed as soon as they have no child nodes and no payload. In this example, if "/:stock/:wood/oak" is deleted and no other tree nodes were added below "/:stock" or "/:stock/:wood", both `stock` and `wood` will be deleted as well. Fixes #140.
c4a1065
to
caa77f5
Compare
For instance, if a caller stores a value in
"/:stock/:wood/oak"
, bothstock
andwood
tree nodes are created on the fly, with no payload attached to them.Now, for these automatically created nodes, a "keep while" condition is added so that they are automatically reclaimed as soon as they have no child nodes and no payload.
In this example, if
"/:stock/:wood/oak"
is deleted and no other tree nodes were added below"/:stock"
or"/:stock/:wood"
, bothstock
andwood
will be deleted as well.Fixes #140.