Skip to content

fix: occasional errors when loading package details

Mario Oenning requested to merge moson/aurweb:fix-package-loading into master

Fixes errors that might occur when loading the package details page.

We are querying a list of "Required by" packages.
This list is loaded with all details for a "PackageDependency" record.

Now we also have a reference to some attributes from the related package (

This will effectively trigger the ORM to run another query (lazyload) to fetch the missing Package data (for each PackageDependency record).

At that point it might have happened that a referenced package got deleted / updated so that we can't retrieve this data anymore and our dep.Package object is "None"

We can force our query to include Package data right away. Thus we can avoid running a separate query (per "required by"...)

As a side-effect we get better performance.

Draft: Still trying to find a proper way to write a test for this.

Signed-off-by: moson-mo

Merge request reports