xapian_db icon indicating copy to clipboard operation
xapian_db copied to clipboard

Dependency Bugfix

Open haslo opened this issue 9 years ago • 0 comments

Hi @gernotkogler :smiley:

I think I might have found a bug. Hooks for dependencies were added to the class that is in the index, and not the classes that the indexed class is dependent on. See the first commit for a failing spec that demonstrates the issue.

The result is as follows:

  • If a source object not in the index changes, and an indexed object depends on it, nothing happens

  • If an indexed object changes, it has a listener that wonders whether the source object changed

    :warning: but it never has changed unless the source object happens to be the indexed object :warning:

The bug might not show up if the source object also happens to be in the index, because that means that it also receives a dependency listener on after_commit. It also didn't show up in the circular dependency in the specs.


While I was at it, I also added an after_destroy hook, where all the fields are considered to have changed when the model has been removed. And I extended the model mocks to be able to handle more than one listener on after_commit and after_destroy.


Please tell me what you think :smile:

haslo avatar Jan 15 '16 15:01 haslo