fix issue where snapshot enqueuer is connecting to the wrong database
Created by: coury-clark
Recently this new snapshot enqueuer was added to support the prototype capture group insight. It seems harmless enough that it was loading the database handle from the transaction in the resolver, but this actually breaks quite badly. In the dev environment we stack all the databases into one, so this works fine. In customer environments these are separate databases, so this handle is pointing at the codeinsights-db
instead of the pgsql
db where the table lives.
These stores and db handles need to become type safe so that this can't ever happen. Ultimately this is an artifact of this debt in the codebase, not the change itself.
Test plan
Generated insights and made sure both global and non-global can queue up work.
Global and scoped standard search: