Closed fmigneault closed 5 years ago
Hello,
I don't think I've made any changes to tree service in last months. And my tests pass as far as I can tell, can you prepare a minimal test case to reproduce this?
It's ok, I was just wondering if you had experienced this before. It seems some entries of my db got corrupted somehow, I don't even know how to reproduce. I have wiped some tables and tried again, and all is working fine as before...
Using
resource_tree_service = ResourceTreeService(ResourceTreeServicePostgreSQL)
, I callresource_tree_service.delete_branch(resource_id=resource.resource_id, db_session=request.db)
, which causes a resource to not be found after in passes: https://github.com/ergo/ziggurat_foundations/blob/5a40c721e59b6cecfa6e1bd5fbb2d369dc12398e/ziggurat_foundations/models/services/resource_tree_postgres.py#L72-L74If I use
list(query.filter(cls.model.resource_id == resource_id))
instead WITHOUT thewith_for_update()
call, the resource is correctly retrieved. With it, it returnsNone
. Any idea why I might be getting this behavior suddenly? I have been using the same methodresource_tree_service.delete_branch(...)
for as long as I can remember and resources where properly removed.