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

Tests and related bugfixes for BaseStore.remove #1165

Conversation

gycsaba96
Copy link
Contributor

I wrote unit tests for BaseStore.remove and discovered 2 bugs along the way:

  • When removing an item, the code only considered the children instead of removing all descendants. This resulted in the store being left in an inconsistent state. (This seems related to the scattered use of BaseStore.refresh_lookup_cache method.)
  • When removing a tree of items, only the root element was reported with a removed signal. (If I am not mistaken, the code never relied on this signal, but let's fix it anyway.)

The main changes are as follows:

  • write unit tests for BaseStore.remove,
  • ensure that all descendants are recursively removed,
  • ensure that a removed signal is emitted for each removed item,
  • make SavedSearch a subclass of StoreItem to keep things readable.

- write unit tests for BaseStore.remove
- ensure that all descendants are recursively removed
- ensure that a removed signal is emitted for each removed item
- make SavedSearch a subclass of StoreItem to keep things readable
@diegogangl
Copy link
Contributor

LGTM, thanks!

@diegogangl diegogangl merged commit c271e2a into getting-things-gnome:master Dec 27, 2024
1 check passed
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.

2 participants