Skip to content

fix issue where snapshot enqueuer is connecting to the wrong database

Administrator requested to merge insights/fix-wrong-db-conn into main

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:

CleanShot 2022-07-13 at 10 27 33@2x

Compute type (the offending type): CleanShot 2022-07-13 at 10 29 07@2x

Merge request reports

Loading