Auto publish does not correctly publish modules when calling hooks
The cause of this is due to that the indexer "lazily" sets the published state of the module in the database.. but this isn't all that's required and it should call calling the publish method on the module, which updates some cache value of the module with the latest version.