Skip to content

Drop the insight metrics Meta retired - #5

Merged
craigphares merged 1 commit into
mainfrom
claude/drop-retired-insight-metrics
Sep 20, 2026
Merged

craigphares merged 1 commit into
mainfrom
claude/drop-retired-insight-metrics

Conversation

@craigphares

Copy link
Copy Markdown
Member

plays and exits are no longer valid metric names. The API validates the whole metric list up front, so one retired name answers 400 for the entire request: every feed video and every reel published through LMP has been recording no insights at all, and FetchMediaInsightsJob rescued the 400 into a log line. Carousels and images were unaffected, which is why it stayed invisible.

Found by probing production media directly. A real feed video rejected the current list with:

metric[6] must be one of the following values: impressions, shares, comments, likes, saved,
replies, total_interactions, navigation, follows, profile_visits, profile_activity, reach,
ig_reels_video_view_total_time, ig_reels_avg_watch_time, views, thread_replies, reposts, ...

metric[6] is plays. The same call succeeded 7/7 with views in its place, verified against the same post. exits does not appear anywhere in that list either, which is why the story set drops it.

  • video: plays → views (verified)
  • reel: drop plays, keep views and the watch-time metrics (unreachable today, since insight_metric_kind maps reels to :video, but it would fail identically)
  • story: drop exits, now reach replies views. Unverified: navigation is what replaced exits, but it reports through a breakdown this client does not ask for yet, so that waits on a live story.

Specs assert no retired name is ever asked for, with the 400-for-the-whole-request reason recorded so the list is only widened against a verified response.

Downstream

Rails pins this gem by ref (Gemfile:64), so this needs a ref bump to ship.

Both clients compute "Total exits" and "Completion rate" from exits (AnalyzeSwiftUIViewModel.swift:381, StoriesAnalytics.tsx:30). With the metric gone they will read "0 exits, 100% completion" rather than erroring, so those two cards need the navigation breakdown or removal.

🤖 Generated with Claude Code

The API validates the whole metric list before it reads any of it, so a
single retired name answers 400 for the request and costs every metric
for that media kind. `plays` had been kept on video and reel on the
belief that v21 still served it. It does not: production rejects it, and
the error names every value the API will accept. `exits` is absent from
that list too, so the story set was failing the same way.

The practical effect was that every feed video and every reel published
through the app recorded no insights at all, while carousels and images
came back whole. The ingestion job rescues the error and logs it, so
nothing surfaced.

Video counts plays as `views` now, verified against a real feed video on
the same call that rejected `plays`. Stories drop `exits` and keep what
the list allows; `navigation` is what replaced it, but it reports
through a breakdown this client does not ask for yet, so that waits on a
live story to check the shape.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@craigphares

Copy link
Copy Markdown
Member Author

@codex review this pr

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 20, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-20T17:26:16.505153Z 8bcda4e Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🎉

Reviewed commit: 8bcda4e3d8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@craigphares
craigphares merged commit 90c177e into main Sep 20, 2026
5 checks passed
@craigphares
craigphares deleted the claude/drop-retired-insight-metrics branch September 20, 2026 17:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant