Skip to content

Record link copies, failed AI drafts and refused publishes #500

Closed

Description

@richshaw

Needs your OK: this adds activity events and changes docs/telemetry.md. Swap pipeline:proposed for pipeline:ready to have it built. Part of #498. Ship it before the review page, so that page's effect can be measured.

What happens

The activity log can't see several of the steps where new organizers stop:

  • Copying or sharing the public link records nothing. That applies to PublicLinkChip and the published banner. So "published but never shared" can't be measured.
  • Magic Compose failures and refusals only reach the server log. "Tried the AI, it failed, gave up" is invisible.
  • A refused publish leaves no trace.
  • Organizer events carry no device class. Drafts abandoned on a phone can't be told apart from drafts abandoned on a computer.
  • signup.draft_started doesn't say which form was shown, Magic Compose or the manual one. It fires on every render of the new-signup page.

Fix, in outline

  • signup.link_copied and signup.link_shared (the second is for the phone share sheet). Send them from the browser on the landing.cta_clicked pattern, but behind the organizer session rather than a per-IP rate limit.
  • magic_compose.failed, carrying the closed error code (not_configured | rate_limited | upstream | invalid_json | schema_mismatch | timeout | aborted, or refusal). Write it outside a transaction, as other telemetry-only events are.
  • signup.publish_refused, carrying the error code.
  • uaClass on organizer page-view events, as public views already have.
  • mode: 'magic' | 'manual' on signup.draft_started.
  • Reserve two events for the review-page checks: review.notice_shown and review.notice_accepted, carrying only the kind of notice.

Watch for

  • Payloads hold codes and kinds only. No emails, no email domains, and no text the organizer wrote. The separate analytics reader allow-lists payload keys, so any new key has to be added there too.
  • Docs: update docs/telemetry.md. Check whether the privacy page needs a line.
  • The activity history view (No organizer-facing view of the activity log #243) will want to leave these events out, as it does page views.

Done when

  • Each event is written by the action it describes, with a test.
  • docs/telemetry.md lists the new events and their payloads.
  • pnpm lint && pnpm typecheck && pnpm knip && pnpm test pass, and pnpm test:db passes for the activity writes.

Planned in https://claude.ai/code/session_01AkZbMUc4ej4ed7o5uh6nqr

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions