mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-17 04:32:31 +03:00
* test(db): RED for LKGP pin invalidation on provider connection delete (#8887) * fix(db): invalidate LKGP pins when their provider connection is deleted (#8887) setLKGP() persists { provider, connectionId } under the `lkgp` namespace of key_value, but none of the three delete paths in db/providers.ts touched that namespace, so a pin outlived the connection it referenced and became unbounded stale state. - Add deleteLKGPByConnectionIds() to its owning module src/lib/db/settings/lkgp.ts (no raw lkgp SQL inside providers.ts). Pins without a connectionId and legacy plain-string pins are left untouched. - Wire it into deleteProviderConnection, deleteProviderConnections and deleteProviderConnectionsByProvider. - Add invalidateCachedLKGP() to readCache.ts so the 5s in-memory lkgpCache cannot serve a pin that was just deleted; called via the lazy-import pattern already used there, so no import cycle (npm run check:cycles OK, 391 files). No change to updateProviderConnection semantics, no session_model_history change, no new API route, no migration. --------- Co-authored-by: 千乘妍 (Xiaoyaner) <xiaoyaner0201@users.noreply.github.com> Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>