Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

chore(support): give the client-side support failure event its own name (#78928)

posthog[bot]c33c341392d3
diff --git a/frontend/src/lib/components/Support/supportLogic.test.ts b/frontend/src/lib/components/Support/supportLogic.test.ts
index aa0b085df159..858064dd24c9 100644
--- a/frontend/src/lib/components/Support/supportLogic.test.ts
+++ b/frontend/src/lib/components/Support/supportLogic.test.ts
@@ -118,7 +118,7 @@ describe('supportLogic', () => {
(posthog.capture as jest.Mock).mock.calls.filter(([event]) => event === 'posthog_ai_support_ticket_created')
const sendFailures = (): unknown[][] =>
- (posthog.capture as jest.Mock).mock.calls.filter(([event]) => event === 'support ticket send failed')
+ (posthog.capture as jest.Mock).mock.calls.filter(([event]) => event === 'support ticket send blocked')
beforeEach(() => {
;(posthog.capture as jest.Mock).mockClear()
diff --git a/frontend/src/lib/components/Support/supportLogic.ts b/frontend/src/lib/components/Support/supportLogic.ts
index 2ff66de3139b..e336974d4ca5 100644
--- a/frontend/src/lib/components/Support/supportLogic.ts
+++ b/frontend/src/lib/components/Support/supportLogic.ts
@@ -143,9 +143,11 @@ function messagePreviewProperties(message?: string): Record<string, any> {
}
}
-// Shares its event name with the widget endpoint's own rejections so one alert covers client and
-// server. Note the backend tags itself `channel_source`, not `channel`.
-export function captureSupportTicketFailed({
+// Deliberately a different event from the widget endpoint's own `support ticket send failed`, which
+// reports requests the server rejected. That one names the offending field but has no session and no
+// draft, so only an engineer can act on it. This one means the message never left the browser, so it
+// carries what the customer wrote and someone can follow up. Two audiences, so keep them apart.
+export function captureSupportTicketBlocked({
surface,
reason,
message,
@@ -160,7 +162,7 @@ export function captureSupportTicketFailed({
is_new_ticket?: boolean
can_create_ticket?: boolean
}): void {
- posthog.capture('support ticket send failed', {
+ posthog.capture('support ticket send blocked', {
channel: 'conversations',
surface,
reason,
@@ -589,7 +591,7 @@ export const supportLogic = kea<supportLogicType>([
// from "the send failed" (usually transient), because they need different advice and the
// volume of each tells us whether the email fallback is carrying real traffic.
const sendFailed = (reason: SupportSendFailureReason, error?: unknown): void => {
- captureSupportTicketFailed({ surface: 'support_form', reason, message, error, kind })
+ captureSupportTicketBlocked({ surface: 'support_form', reason, message, error, kind })
if (reason === 'widget_unavailable') {
warnSupportWidgetUnavailable()
return
@@ -608,7 +610,7 @@ export const supportLogic = kea<supportLogicType>([
// matches what the widget endpoint actually receives and rejects
const outgoingMessage = appendExceptionToMessage(message, exception_event)
if (warnIfMessageTooLong(outgoingMessage)) {
- captureSupportTicketFailed({
+ captureSupportTicketBlocked({
surface: 'support_form',
reason: 'message_too_long',
message: outgoingMessage,
diff --git a/products/conversations/frontend/components/SidePanel/sidepanelTicketsLogic.test.ts b/products/conversations/frontend/components/SidePanel/sidepanelTicketsLogic.test.ts
index 8bf4ababf2bc..57f0e57e2ee9 100644
--- a/products/conversations/frontend/components/SidePanel/sidepanelTicketsLogic.test.ts
+++ b/products/conversations/frontend/components/SidePanel/sidepanelTicketsLogic.test.ts
@@ -141,7 +141,7 @@ describe('sidepanelTicketsLogic', () => {
}).toFinishAllListeners()
const failures = (posthog.capture as jest.Mock).mock.calls.filter(
- ([event]) => event === 'support ticket send failed'
+ ([event]) => event === 'support ticket send blocked'
)
expect(failures).toHaveLength(1)
expect(failures[0][1]).toMatchObject({
@@ -194,7 +194,7 @@ describe('sidepanelTicketsLogic', () => {
expect(logic.values.view).toBe('new')
// Nothing was turned away, so there is no lost-submit to report
expect(
- (posthog.capture as jest.Mock).mock.calls.filter(([event]) => event === 'support ticket send failed')
+ (posthog.capture as jest.Mock).mock.calls.filter(([event]) => event === 'support ticket send blocked')
).toHaveLength(0)
})
@@ -359,7 +359,7 @@ describe('sidepanelTicketsLogic', () => {
expect(onSuccess).not.toHaveBeenCalled()
expect(logic.values.messageSending).toBe(false)
const failures = (posthog.capture as jest.Mock).mock.calls.filter(
- ([event]) => event === 'support ticket send failed'
+ ([event]) => event === 'support ticket send blocked'
)
expect(failures).toHaveLength(1)
expect(failures[0][1]).toMatchObject({ reason: 'widget_unavailable' })
@@ -401,7 +401,7 @@ describe('sidepanelTicketsLogic', () => {
expect(onSuccess).not.toHaveBeenCalled()
const failures = (posthog.capture as jest.Mock).mock.calls.filter(
- ([event]) => event === 'support ticket send failed'
+ ([event]) => event === 'support ticket send blocked'
)
expect(failures).toHaveLength(1)
expect(failures[0][1]).toMatchObject({
diff --git a/products/conversations/frontend/components/SidePanel/sidepanelTicketsLogic.ts b/products/conversations/frontend/components/SidePanel/sidepanelTicketsLogic.ts
index ebed531a310d..9d5080281cb7 100644
--- a/products/conversations/frontend/components/SidePanel/sidepanelTicketsLogic.ts
+++ b/products/conversations/frontend/components/SidePanel/sidepanelTicketsLogic.ts
@@ -17,7 +17,7 @@ import posthog from 'posthog-js'
import {
appendExceptionToMessage,
- captureSupportTicketFailed,
+ captureSupportTicketBlocked,
captureSupportWidgetLoadFailed,
SUPPORT_WIDGET_UNAVAILABLE_MESSAGE,
supportLogic,
@@ -563,7 +563,7 @@ export const sidepanelTicketsLogic = kea<sidepanelTicketsLogicType>([
// Bailing quietly here left the button un-loaded and the typed message sitting in the box
// with no explanation, which is the worst version of this now conversations is the only channel
if (!posthog.conversations) {
- captureSupportTicketFailed({
+ captureSupportTicketBlocked({
surface: 'side_panel_composer',
reason: 'widget_unavailable',
message: content,
@@ -573,7 +573,7 @@ export const sidepanelTicketsLogic = kea<sidepanelTicketsLogicType>([
return
}
if (warnIfMessageTooLong(content)) {
- captureSupportTicketFailed({
+ captureSupportTicketBlocked({
surface: 'side_panel_composer',
reason: 'message_too_long',
message: content,
@@ -607,10 +607,10 @@ export const sidepanelTicketsLogic = kea<sidepanelTicketsLogicType>([
onSuccess()
} else {
// A null response means nothing was sent, so surface it instead of silently
- // resetting. The widget endpoint reports its own rejections under the same event
- // name, but it can't see a send the extension declined to make — and only the
- // client still holds the draft, which is the part a responder needs.
- captureSupportTicketFailed({
+ // resetting. The widget endpoint reports the rejections it sees itself, but it
+ // can't see a send the extension declined to make — and only the client still
+ // holds the draft, which is the part a responder needs.
+ captureSupportTicketBlocked({
surface: 'side_panel_composer',
reason: 'widget_declined',
message: content,
@@ -622,7 +622,7 @@ export const sidepanelTicketsLogic = kea<sidepanelTicketsLogicType>([
}
} catch (e) {
console.error('Failed to send message:', e)
- captureSupportTicketFailed({
+ captureSupportTicketBlocked({
surface: 'side_panel_composer',
reason: 'send_failed',
message: content,
@@ -668,7 +668,7 @@ export const sidepanelTicketsLogic = kea<sidepanelTicketsLogicType>([
// before any composer is on screen, so nothing has been typed yet. Every CTA that
// reaches here passes no message either. What's lost is the customer's intent to
// reach us, which is what the event records.
- captureSupportTicketFailed({
+ captureSupportTicketBlocked({
surface: 'support_form',
reason: 'not_entitled',
kind: values.sendSupportRequest?.kind,