Skip to content

chore(react-native-plugin): bump posthog-android to 3.74.2 - #5489

Merged
turnipdabeets merged 5 commits into
mainfrom
feat/rn-plugin-posthog-android-3-74
Oct 30, 2026
Merged

turnipdabeets merged 5 commits into
mainfrom
feat/rn-plugin-posthog-android-3-74

Conversation

@ioannisj

@ioannisj ioannisj commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Problem

posthog-android 3.74.0 (PostHog/posthog-android#906) changes the session replay screenshot default. sessionReplayConfig.screenshotScale is now Float?, null is the default and means one pixel per dp (about 1/9 of the pixels on a 3x screen), and an explicit value keeps its old meaning. Non-finite values reset to null.

posthog-android 3.74.2 (PostHog/posthog-android#910) also records FLAG_SECURE windows fully masked, drops their touches, and discards frames where an animating view would expose masked content.

The plugin pins posthog-android at 3.72.9, so React Native apps get neither the smaller uploads nor the privacy fixes. Two plugin tests also assert the old 1f default and fail against 3.74.0 and later.

Changes

  • Bumps com.posthog:posthog-android from 3.72.9 to 3.74.2 in packages/react-native-plugin/android/build.gradle.
  • The bridge only forwards screenshotScale when the JS config sets it, so RN apps that leave it unset pick up the 1x default automatically. screenshotScale: 1 keeps native resolution.
  • applyScreenshotConfig in packages/react-native-plugin/android/src/main/java/com/posthogreactnativeplugin/PosthogReactNativePluginModule.kt used to map a non-finite scale to 1f. It now skips the assignment so the native default applies, matching Android. This path isn't reachable from posthog-react-native, which strips non-finite values before the bridge.
  • Updates the plugin tests to expect null as the default, and adds a 1.0 to 1f case so the documented opt-out is pinned.
  • Fixes the @default on screenshotScale in packages/react-native/src/types.ts, which still said 1.0.
  • Changesets: minor for @posthog/react-native-plugin (the default replay resolution changes for apps that never set the option), patch for posthog-react-native (doc only).

I ran the plugin's Android unit tests through examples/example-rn-native-plugin/android against the published 3.74.2 artifact (26 pass), plus packages/react-native's session-replay-screenshot-config.spec.ts (19 pass).

Release info Sub-libraries affected

Libraries affected

  • All of them
  • posthog-js (web)
  • posthog-js-lite (web lite)
  • posthog-node
  • posthog-react-native
  • @posthog/react-native-plugin
  • @posthog/react
  • @posthog/ai
  • @posthog/convex
  • @posthog/next
  • @posthog/nextjs-config
  • @posthog/nuxt
  • @posthog/openfeature-node-provider
  • @posthog/openfeature-web-provider
  • @posthog/rollup-plugin
  • @posthog/webpack-plugin
  • @posthog/types
  • @posthog/browser-common

Checklist

  • All commits are signed (see Commit signing)
  • Tests for new code
  • Accounted for the impact of any changes across different platforms
  • Accounted for backwards compatibility of any changes (no breaking changes!)
  • Took care not to unnecessarily increase the bundle size

If releasing new changes

  • Ran pnpm changeset to generate a changeset file

🤖 Agent context

DRI: @ioannisj
Autonomy: Human-driven (agent-assisted)

@ioannisj ioannisj self-assigned this Oct 30, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Coherence

📄 0 spec file errors · ⛔ 0 broken rules · 🚪 2 unchecked inputs · 🐛 0 bugs that came back

What is Coherence?

Coherence compares the code with its spec files (*.spec.md). A spec file lists the rules for one part of the code.

This check read 44 parts of the code and 7 rules.

Note

These findings do not make this check fail.

None of these findings are in files that this pull request changes. You do not need to fix them in this pull request.

🚪 Unchecked inputs (2)

  • public api in packages/web/Web.spec.md. The input comes from: host-app.
  • webpack plugin in packages/webpack-plugin/Webpack-plugin.spec.md. The input comes from: build.
What this means and how to fix it

Input from outside this code comes in at these places. The spec does not say what checks that input. 10 more places were already like this when Coherence was added. This list does not show them.

To close one of these, find the place by its name in the ## entrances section of its spec file. Add one line under it:

  • If all of the input goes through one function that a rule in the spec protects, add guard: <function>.
  • If a rule in the spec already checks input from the same source, add the place's name to the entrances: line of that rule.
  • If the input needs no check, add control: none - <reason>.

To get the line to add, run npx --no -- coherence scaffold control "<name>".

@turnipdabeets turnipdabeets left a comment

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.

[suggestion] If this carries PostHog/posthog-android#910, could we update the title and description to the new version, drop the #5483 paragraph, and rerun the plugin's Android tests against it? The 26 passes were against 3.74.0.

Comment thread .changeset/jolly-geese-talk.md Resolved
@turnipdabeets
turnipdabeets marked this pull request as ready for review October 30, 2026 15:42
@turnipdabeets
turnipdabeets requested a review from a team as a code owner October 30, 2026 15:43
Carries the FLAG_SECURE and animating-view replay fixes from PostHog/posthog-android#910.
@turnipdabeets turnipdabeets changed the title chore(react-native-plugin): bump posthog-android to 3.74.0 chore(react-native-plugin): bump posthog-android to 3.74.2 Oct 30, 2026
@turnipdabeets
turnipdabeets added this pull request to the merge queue Oct 30, 2026
Merged via the queue into main with commit a055ee6 Oct 30, 2026
79 of 82 checks passed
@turnipdabeets
turnipdabeets deleted the feat/rn-plugin-posthog-android-3-74 branch October 30, 2026 16:58
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.

2 participants