Skip to content

fix(desktop): capture inbox feedback notes - #103900

Merged
trunk-io[bot] merged 1 commit into
masterfrom
posthog/desktop-inbox-feedback-notes
Sep 21, 2026
Merged

trunk-io[bot] merged 1 commit into
masterfrom
posthog/desktop-inbox-feedback-notes

Conversation

@dmarticus

Copy link
Copy Markdown
Contributor

Problem

Desktop reviewers can submit qualitative report feedback, but some analytics events omit the text and make cross-client analysis incomplete.

Closes #103632

Changes

  • Desktop feedback events now capture the full reviewer note within the existing input limit.
  • Dismiss events now include the optional dismissal note.
  • Successful refund actions now include the refund reason and optional note.
  • The web event shape remains the shared analytics contract.
  • This change has no visible UI difference, so screenshots do not apply.

How did you test this code?

  • Focused Vitest suites cover feedback notes, dismissal notes, and refund events.
  • pnpm --dir products/desktop typecheck
  • pnpm --dir products/desktop lint
  • ./bin/hogli ci:preflight --fix
  • Manual testing was not run.

👉 Stay up-to-date with PostHog coding conventions for a smoother review.

Automatic notifications

  • Publish to changelog?

Docs update

No public docs update is needed because this change only aligns internal analytics payloads.

🤖 Agent context

Autonomy: Human-driven (agent-assisted)

Agent: PostHog Slack app, GPT-5

  • Session: Slack thread
  • Skills: /posthog-desktop, /writing-tests, /writing-code-comments, /running-ci-preflight, /reviewing-with-coderabbit, and /writing-pr-descriptions.
  • Duplicate search: no open pull request matched this fix.
  • CodeRabbit CLI was unavailable, so the PR opened without a local CodeRabbit pass.
  • The patch uses invented test text and includes no private session data.

Created with PostHog from a Slack thread

Generated-By: PostHog Desktop
Task-Id: 9052dba2-fd18-4272-b44c-7da9eddb32cf
@dmarticus dmarticus self-assigned this Sep 21, 2026
@trunk-io

trunk-io Bot commented Sep 21, 2026 •

Copy link
Copy Markdown

😎 Merged successfully - details.

@dmarticus dmarticus added the skip-inkeep-docs Use this label to skip an Inkeep docs PR in posthog.com label Sep 21, 2026 — with PostHog
@github-actions github-actions Bot added the feature/desktop Feature Tag: Desktop label Sep 21, 2026
@github-actions

Copy link
Copy Markdown
Contributor

React Doctor found no issues in the changed files. 🎉

Reviewed by React Doctor for commit 6d2658c.

@github-actions

github-actions Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

🤖 CI report

✅ Trunk lane — non-backend lane (fe:product:desktop)

This PR is assigned to the non-backend lane (fe:product:desktop). It does not run backend Python tests and may merge in parallel with PRs in other lanes.

✅ Duplication (Python) — clean

New Python code duplication introduced by this branch. Fails at 70+ tokens in app code, or 150+ tokens when both copies live in test files. Advisory while the gate proves itself: extract a shared helper instead of copying.

✅ Duplication (TypeScript) — clean

New TypeScript code duplication introduced by this branch. Fails at 70+ tokens in app code, or 150+ tokens when both copies live in test files. Advisory while the gate proves itself: extract a shared helper instead of copying.

@greptile-apps

greptile-apps Bot commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

Retrigger

The PR appears safe to merge.

Reviews (1) · Last reviewed commit: "fix(desktop): capture inbox feedback not..."

@coderabbitai

coderabbitai Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

Understand this PR’s impact

Explore downstream dependencies and potential security impact with Blast Radius.

View blast radius →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: PostHog/posthog/.coderabbit.yaml

Review profile: QUIET

Plan: Enterprise

Run ID: 9a42fd83-0bd1-49b5-82a2-6e3e43316226

📥 Commits

Reviewing files that changed from the base of the PR and between 1642630 and 6d2658c.

📒 Files selected for processing (8)
  • products/desktop/packages/core/src/inbox/engagement.test.ts
  • products/desktop/packages/core/src/inbox/engagement.ts
  • products/desktop/packages/shared/src/analytics-events.ts
  • products/desktop/packages/ui/src/features/inbox/components/detail/ReportFeedbackFooter.test.tsx
  • products/desktop/packages/ui/src/features/inbox/hooks/useInboxBulkActions.ts
  • products/desktop/packages/ui/src/features/inbox/hooks/useRefundReport.test.tsx
  • products/desktop/packages/ui/src/features/inbox/hooks/useRefundReport.ts
  • products/desktop/packages/ui/src/features/inbox/hooks/useReportFeedbackTracker.ts

Included review availability: Your plan provides up to 12 included reviews per hour; 11 remain after this review.


📝 Walkthrough

Walkthrough

Desktop inbox analytics now records feedback note text instead of its length. Bulk dismiss events can include a non-empty dismissal note, while snooze events omit dismissal fields. Inbox analytics types add refund actions, refund reasons, and refund notes. Successful refunds now emit a refund analytics event with the reason and optional note. Tests cover feedback, dismissal, snooze, and refund payloads.

Priority: ➖ Normal

Severity of issue fixed: Medium

🚥 Pre-merge checks | ✅ 1
✅ Passed checks (1 passed)
Check name Status Explanation
Description check ✅ Passed The description includes the required Problem, Changes, testing, notifications, docs, and agent context sections. It states the user impact, linked issue, analytics changes, automated checks, lack of …
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Comment @coderabbitai help to get the list of available commands.

@hosthog

hosthog Bot commented Sep 21, 2026 •

Copy link
Copy Markdown

HostHog preview — posthog-desktop-web

The previews for this PR have been torn down and no longer serve.

@dmarticus
dmarticus marked this pull request as ready for review September 21, 2026 16:54
@dmarticus dmarticus added the stamphog Request AI approval (no full review) label Sep 21, 2026
@pr-assigner-resolver-posthog
pr-assigner-resolver-posthog Bot requested a review from a team September 21, 2026 16:55
...base,
sentiment,
note_length: text.length,
note: text,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Free-text reviewer/refund/dismissal notes now sent verbatim to analytics

This change replaces a privacy-preserving note_length: number field with the raw note: text content in the INBOX_REPORT_FEEDBACK_NOTE event, and adds dismissal_note/refund_note free-text fields to INBOX_REPORT_ACTION. These notes are free-form text typed by desktop reviewers about customer reports (support/PR review context) and up to 4000 characters (FEEDBACK_NOTE_MAX_LENGTH), so they can contain customer PII, account details, or other sensitive business data. The removed comment at products/desktop/packages/ui/src/features/inbox/hooks/useReportFeedbackTracker.ts previously stated explicitly: "analytics captures only the note length, never its contents" — that safeguard is now gone with no redaction, scrubbing, or consent gate before the text is forwarded to the analytics pipeline (track(...) → PostHog capture, which may be replicated to data warehouses/third parties and viewed by a much broader audience than the original reviewer note).

Concretely: products/desktop/packages/ui/src/features/inbox/hooks/useReportFeedbackTracker.ts:46-50 sends note: text verbatim; products/desktop/packages/ui/src/features/inbox/hooks/useRefundReport.ts:34-37 sends refund_note: input.note; products/desktop/packages/core/src/inbox/engagement.ts:105-107 propagates dismissal_note. None of these paths apply any sanitization/redaction before the text leaves the client into the analytics event stream. Recommend either reverting to length/hash-only capture, or explicitly classifying these fields as free-text/PII in the analytics pipeline and gating their storage/visibility (e.g., excluding from broadly-replicated warehouses, redacting known PII patterns) before shipping this contract change.


Severity: medium | Confidence: 55% | React with 👍 if useful or 👎 if not

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was by design

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Understood — since capturing the full note text is the intentional purpose of this PR (per the description: "Desktop feedback events now capture the full reviewer note"), I'll treat this as accepted/by design rather than a defect to fix in this PR. I'd still flag for the team, outside of this review, that these notes are free text potentially containing customer PII or sensitive business details, so it's worth confirming the analytics pipeline's data handling/retention policy accounts for that (e.g., PII scrubbing rules, warehouse replication scope) rather than treating it as opaque length-only telemetry going forward. No further action needed from me here.

@stamphog stamphog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved.

Changes analytics event payloads to include note text instead of just length — a disclosed, intentional change to the event contract, and the author is on the owning team with strong recent familiarity in these exact files, which satisfies the independent-assurance bar for that risky-adjacent surface. Tests were updated/added to cover the new fields.

  • Author wrote 89% of the modified lines and has 29 merged PRs in these paths (familiarity STRONG).
  • 👍 on the PR from greptile-apps[bot].
  • 8 of the 8 changed files are governed by products/desktop/AGENT_APPROVALS.md.
Gate mechanics and policy version
Gate Result
prerequisites ✓ all clear
deny-list ✓ no deny categories matched
size ✓ 33L, 5F substantive, 130L/8F incl. docs/generated/snapshots — within ceiling
tier ✓ T1-agent / T1c-medium (130L, 8F, single-area, fix)
stamphog 2.0.0 .stamphog/policy.yml @ 6d2658c · reviewed head 6d2658c

...base,
sentiment,
note_length: text.length,
note: text,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Medium: Sensitive note contents enter telemetry

A user can now send arbitrary sensitive text into the shared analytics project by entering it in a feedback note. The same raw-text sink is added for dismissal notes in useInboxBulkActions.ts and refund notes in useRefundReport.ts; retain only non-content metadata such as note presence or length, or send the text through a dedicated access-controlled feedback channel with appropriate retention and disclosure.

@veria-ai

veria-ai Bot commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

PR overview

This PR updates the desktop inbox feedback flow to capture notes associated with feedback, dismissals, and refund reports.

One security issue remains open: raw user-entered note contents are sent to the shared analytics system, potentially exposing sensitive information through telemetry. No issues have yet been addressed, so note collection should be limited to non-content metadata or routed through an appropriately controlled feedback channel.

Open issues (1)

Fixed/addressed: 0 · PR risk: 6/10

@trunk-io
trunk-io Bot merged commit 85b30fd into master Sep 21, 2026
386 of 389 checks passed
@trunk-io
trunk-io Bot deleted the posthog/desktop-inbox-feedback-notes branch September 21, 2026 17:27
@deployment-status-posthog

deployment-status-posthog Bot commented Sep 21, 2026 •

Copy link
Copy Markdown

Deploy status

Environment Status Deployed At Workflow
dev ✅ Deployed 2026-09-21 17:53 UTC Run
prod-us ✅ Deployed 2026-09-21 18:06 UTC Run
prod-eu ✅ Deployed 2026-09-21 18:07 UTC Run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature/desktop Feature Tag: Desktop skip-inkeep-docs Use this label to skip an Inkeep docs PR in posthog.com stamphog Request AI approval (no full review)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(signals): Desktop inbox feedback discards the reviewer's note text

1 participant