Open
Description
In the course of working on the other agent publications issues, I've noticed that the live_spec_flows
table contains references to live_specs
rows for specs that have been deleted. Running this query returns 39 such results:
select
f.*,
lsa.spec_type as source_type,
lsb.spec_type as target_type,
lsa.catalog_name as source_name,
lsb.catalog_name as target_name
from live_spec_flows f
join live_specs lsa on f.source_id = lsa.id
join live_specs lsb on f.target_id = lsb.id
where lsa.spec_type is null or lsb.spec_type is null;
The spec expansion logic filters out any rows where spec is null, and the draft spec pruning query seems like it would be unaffected by this. Those are the only two usages of live_spec_flows
that I'm aware of, so I don't think this will cause any immediate problems. But it is incorrect and so we should fix it before it does lead to problems in the future.