# Support feedback and Slack operations (#4170)

The v2 “Ge feedback” dialog keeps the existing support email and adds a saved delivery intent on the existing feedback record. Slack is an optional second notification. This document describes the local implementation; it does not authorize deployment, credential access or a real notification.

## Release order

1. Verify the final source, compiled asset manifest and canonical version together. Retain the previous code/assets and the existing private database backup under the release runbook.
2. Apply only 2026_10_20_200000_add_support_feedback_delivery_claims.php before serving the new dialog. It adds five nullable columns and a unique nullable submission_key; existing feedback rows remain unchanged. Existing forms without an intent keep the prior support-email path. New forms fail before sending when the migration is missing.
3. Deploy the matched source and built assets. The application provider loads only config/feedback.php independently of cached configuration. Preserve the existing SMS-sensitive bootstrap/cache/config.php bytes: do not run config:cache or clear shared caches.
4. Keep slack_enabled=false and webhook_url=null until the responsible person identifies the intended channel and approves its integration and test. Company design selection is unchanged. Slack is eligible only for v2-selected requests; a company flag rollback suppresses a still-pending Slack notification while retaining durable support-email handling.
5. Lint the static PHP file before activation. The existing cached deployment catches missing, invalid and throwing feedback configuration and fails closed. A syntax-broken file during an uncached Laravel LoadConfiguration boot retains the framework limitation documented for the editor; release PHP lint and exact file rollback are required.
6. With separate live-test authority, submit one uniquely identifiable synthetic report through the real dialog and verify the saved row, support inbox and actual Slack destination. Local ArrayTransport/HTTP fakes and mocked browser acknowledgments are not live delivery proof.

## Destination setup

A deployment-owned incoming webhook must be bound to the approved Slack channel. Only a canonical HTTPS hooks.slack.com/services URL is accepted. Never place a real webhook value in source control, a task comment, browser JavaScript, command output or an evidence export. Use the established credential/deployment mechanism and restrictive server file access; the committed default contains no secret. Creating a Slack app, obtaining a webhook or accessing credentials requires the responsible user's existing authorization.

The notification contains bounded plain-text feedback plus internal company/user IDs, company name, page label and canonical application origin. User-controlled markup cannot choose the destination or issue Slack mentions. It does not include the user's email address or the current page query string. Feedback text itself may contain user-provided information; confirm the channel is suitable before enabling it.

## Delivery states and safe operator response

The UUID is scoped to the authenticated actor and effective company. The server stores a body hash and rejects reuse with different content. It atomically claims support email and then Slack before each external call.

| State | Meaning | Operator action |
| --- | --- | --- |
| pending | No transport has claimed this step | An ordinary retry with the same intent can claim it. |
| sending | A request claimed it; the final outcome may be in flight or interrupted | Reconcile the actual destination and saved record. Do not reset or resend automatically. |
| sent | The configured transport acknowledged this step | Do not replay it. An email acknowledgment is transport acceptance, not inbox delivery proof. |
| unknown | A transport error left the outcome uncertain | Inspect the destination using approved access; preserve the original row and intent. Any manual resend is a separate explicit decision. |
| failed | Slack returned a non-success or unexpected acknowledgment | Preserve the saved feedback and support-email result; no automatic replay occurs. |
| disabled | Slack was not enabled/eligible when this step was claimed | It is not retrospectively replayed when Slack is enabled later. |

The dialog clears its text and rotates its UUID only after HTTP200 JSON status1. Failure, malformed acknowledgments and pending results retain both. Slack failure does not erase accepted feedback or the successful support email. If an email remains unknown, the client retains its text; copying it into a new submission would create a new intent and may duplicate an already-delivered message, so reconcile first.

There is no background retry queue, state-reset endpoint or bulk resend in this change. Logs contain feedback IDs and state/exception class, not webhook values or feedback bodies. Retention uses the existing feedback/user lifecycle; this release does not introduce a new retention duration.

## Rollback

First disable Slack in the deployment-owned static file, preserving the channel secret through the approved mechanism. Company design flags can be rolled back independently; intent-bearing forms already open in a browser still use durable claims but suppress new Slack delivery. Keep the nullable columns and unique claims: migration down intentionally does not drop them. Do not delete rows or reset delivery states to replay them. An older-binary rollback needs its own compatibility decision; this document does not qualify it.

The final release receipt must bind the source, migration, assets, static disabled defaults, unchanged shared configuration cache, company selection and any separately authorized actual consumer proof.
## Existing Xile vault integration (2026-10-21)

The shared Xile incoming webhook is held by the native Xherd KeePass entry named `Xile Software/Xile/SLACK WEBHOOK URL`. Agents may discover the entry name; its value must enter an owned, echo-disabled SSH prompt through the supported `terminal_type_secret` operation. Never copy the value to a command argument, chat, task comment, source, local artifact, or another project's runtime environment. Use the existing native vault rather than asking the user to supply the value again. This records the approved Nuhet setup path, not new general credential authority.

Production's deployment-owned `config/feedback.php` may reference the private runtime file `storage/app/nuhet-feedback-slack-4170/webhook`. Its directory is mode0750 and its file mode0640, owned by the operational user and group www-data; both must remain outside the public tree and ignored by Git. Keep a secret-free copy of the prior disabled static configuration for exact rollback. Verify readability through a fresh application boot as www-data. Shared configuration-cache bytes remain unchanged.

Slack webhook paths contain reusable credentials. `WebhookHttpFactory` therefore uses its own Laravel HTTP factory without the application event dispatcher or global middleware. Submission and the bounded native verification use this factory, retain connection/request timeouts, refuse redirects, and handle ambiguous delivery without replay. Do not replace it with the global Http facade: the installed Sentry integration records full URI paths in breadcrumbs and spans. Ordinary application HTTP tracing remains enabled and unchanged.

One uniquely labelled, generic synthetic server message can qualify native credential readability, production configuration and actual Slack destination. Verify its exact marker and Nordic text in the intended private #log channel. HTTP200/ok alone is insufficient. Keep its once-only claim and reconcile the destination before any further send if a result is unknown. This test does not create customer feedback, send a support email, impersonate an authenticated user, or qualify the full browser dialog; that remains the agreed human testing path. A wrong destination requires disabling the owned activation while preserving the evidence and claim.