fix: project filter was not properly saved in webhook modal#2834
Conversation
|
Qovery can create a Preview Environment for this PR.
This comment has been generated from Qovery AI 🤖.
|
|
View your CI Pipeline Execution ↗ for commit 79a354e
💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗ ☁️ Nx Cloud last updated this comment at |
|
/qovery preview 28c47145-c8e7-4b9d-8d9e-c65c95b48425 |
|
A preview environment was automatically created via Qovery. Another comment will be posted when deployments are finished |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## staging #2834 +/- ##
===========================================
- Coverage 48.18% 47.40% -0.78%
===========================================
Files 1267 1183 -84
Lines 27075 25618 -1457
Branches 7890 7634 -256
===========================================
- Hits 13046 12145 -901
+ Misses 11809 11414 -395
+ Partials 2220 2059 -161
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Your preview environment has been successfully deployed ! |
|
🎉 This PR is included in version 1.330.1 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Issue reported in Pylon ticket 4551
Root cause: in libs/shared/ui/src/lib/components/inputs/input-tags/input-tags.tsx, the InputTags component (used for the webhook "Project name filter" and the settings "Contact emails" field) only committed typed text into the tags array when the user pressed Enter. There was no commit on blur or before submit. So if you typed a project name and clicked Save directly (a very natural thing to do — the "press Enter" hint is easy to miss), the text sitting in the input was silently discarded, and the value never made it into project_names_filter. The saved webhook came back with an empty (or unchanged) filter, which looked like the value "disappeared."
Confirmed by tracing the whole path (form defaults, submit handler, API payload, cache invalidation) — everything else was correct; the existing passing tests only ever simulated pressing Enter, which is why this never surfaced.
Fix: added an onBlur handler on the tag input that commits any pending typed value (same logic as Enter, factored into a shared commitTag helper) in input-tags.tsx:58-88,128. Since blur fires on mousedown before the Save button's click handler runs, this covers exactly the "type then click Save" flow.
Added a regression test in webhook-crud-modal.spec.tsx that types a project filter without pressing Enter and asserts it's still included in the edit payload. All 17 webhook tests and the 6 InputTags unit tests pass.