Skip to content

fix: Correctly handle recursive filtering #438

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

Merged
merged 1 commit into from
Jun 29, 2024
Merged

Conversation

mwcampbell
Copy link
Contributor

I discovered that this was a problem when testing a GTK app with the actual AT-SPI adapter. Attempting to unregister the interfaces for a removed node resulted in a D-Bus error saying that the Accessible interface hadn't been registered in the first place. The problem was that the node wasn't registered in the first place, since its parent had the hidden flag set, meaning that the parent's filter result was ExcludeSubtree. But when the node was removed, its filter result was Include, since calling filter on the node didn't check the parent, and the node itself didn't have the hidden flag set.

So now, common_filter checks the parent.

I added add_subtree and remove_subtree because a callback to node_updated on a single node can indicate a change in the visibility of the whole subtree. And I added the added_nodes and removed_nodes sets to ensure that no matter what sequence of events happens, we don't try to register or unregister a node twice in a single set of changes.

Copy link
Member

@DataTriny DataTriny left a comment

Choose a reason for hiding this comment

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

This is an edge case I admitedly didn't think at the time. Thanks.

@DataTriny DataTriny merged commit 72f9b42 into main Jun 29, 2024
10 checks passed
@DataTriny DataTriny deleted the recursive-filter branch June 29, 2024 10:11
@mwcampbell mwcampbell mentioned this pull request Jun 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants