perf(webapp): scope env var create pre-check to submitted keys (#4579)

## Summary

Setting or importing environment variables ran a conflict pre-check that
loaded every variable in the project and every value across all of its
environments, only to decide whether the submitted keys already had a
value in the target environments. On projects with many variables and
environments that meant reading tens of thousands of rows on each
create/import call.

This scopes the pre-check to the submitted keys and target environments,
so it reads only the rows it actually inspects (submitted keys × target
envs), wrapped in `boundedIn` to keep the prepared-statement cache
stable. Same conflict detection, a handful of rows instead of the whole
project's env-var values.
This commit is contained in:
Eric Allam
2026-08-12 08:15:27 +01:00
committed by GitHub
parent 9a3bee0288
commit 26cdedda1c
2 changed files with 18 additions and 1 deletions
@@ -0,0 +1,6 @@
---
area: webapp
type: improvement
---
Speed up setting and importing environment variables for projects with many variables.