Subscribed hosts are not showing all the repos they should be - again

Problem: Subscribed hosts are not showing all the repos they should be

Expected outcome: Hosts show the repos that the UI says should be enabled

Foreman and Proxy versions: 3.4.1/4.6.2

Foreman and Proxy plugin versions: 3.4.1/4.6.2

Distribution and version: RHEL8

Other relevant data:
Hello, I came across this problem again and hopefully fixed it via solution described in Custom repository is not available on the client system even after attaching the right subscription. - Red Hat Customer Portal. It seems to me that in Satellite 6.12.2 this has been addressed somehow via 2150116 – Entitlement certificate is missing content section for a custom product. Will it be backported to upstream too ? It is really annoying issue, because repositories disappear quite accidentally. Thank you.

Both Fixes #35599 - Add rake task to identify missing content in Candlepin by chris1984 · Pull Request #10309 · Katello/katello · GitHub and are available in Katello 4.7.
Please upgrade your environment.

Thank you for your quick reply but as far as I can see from the pull requests, those actually do not solve the problem, the first pull request contains a rake task to identify missing content and second pull request fails content view publishing if there is a problem. OK better than nothing.

The Candlepin fixes are in the following versions:

Fixed In Version: candlepin-4.0.20-1, candlepin-4.1.19-1 → candlepin-4.0.20-1, candlepin-4.1.19-1, candlepin-4.2.11-1

Katello 4.8 will have Candlepin 4.2.13, which includes the CP fix.