Init the item_id to 0 in the loop: if not, in case of multiple objects A and B, if the resolving of A suceeds and that of B fails, the id of A will be assigned to B
Make api to retrieve the dependencies of a package public, as we use it in a test in another package, swith to the api that will retrieve the cached value instead of re-computing the result