1.407.0
Minor Changes
-
#4222
0f2407bThanks @turnipdabeets! - feat: add a default-value option toisFeatureEnabledisFeatureEnabled(key, { defaultValue: false })now returns the given default when the flag has no value — flags not loaded yet, or no flag with that key — and the return type narrows toboolean. The option name is the same in posthog-js, posthog-js-lite, and posthog-react-native. WithoutdefaultValue, behavior is unchanged:boolean | undefined. (2026-07-22)
Patch Changes
-
#4203
90e7483Thanks @posthog! - fix(conversations): let users start a new conversation while a ticket is still openThe support widget now surfaces the ticket list navigation (and its "New conversation"
button) whenever the user has any ticket, instead of only when they have multiple tickets
or a single resolved one. Previously a user sitting on one open, unresolved ticket was
locked into that conversation with no way to raise a second issue. (2026-07-22) -
#4221
da6e082Thanks @posthog! - fix(exception-autocapture): don't throw when the page's onerror handler is non-callableThe wrapped
window.onerror,window.onunhandledrejection, andconsole.errorhandlers
chained to the page's original handler using optional chaining, which only guards against
null/undefined. When a page had one of these set to a truthy non-callable value (e.g.
viaObject.defineProperty, or clobbered by another script/extension), our wrapper threw a
TypeErrorfrom inside its own handler. We now check the original handler is actually
callable before invoking it and fall back tofalseotherwise. (2026-07-22) -
#4209
569fc62Thanks @posthog! - Session recording no longer emits an uncaughtTypeError: Illegal invocationfrom the input observer's synchronous native-setter call. The previous fix only guarded the deferred hooked setter; the synchronousoriginal.set.call(this, value)still ran with a non-nativethis(a proxy, custom element, or cross-realm object) and threw inside the host page's own assignment. The recorder now probes the native getter — which fails the same internal-slot brand check as the setter — before forwarding: a non-nativethisis skipped, so the recorder no longer re-throws from its own frame, while genuine elements (including file inputs that legitimately throw on a programmatic value) keep their native behavior. The input event handler andgetInputTypeare similarly guarded against reading native accessors on a non-nativethis.
(2026-07-22) -
#4068
d5e1188Thanks @posthog! - Fix event-triggered surveys re-displaying in a fresh session without their trigger firing. A non-repeatable event/action-triggered survey that was shown but never dismissed or answered had its activation persisted indefinitely, so it kept being treated as "triggered" on later page loads. The persisted activation is now scoped to the triggering session: it still survives a reload within that session, but a brand-new session drops it until the trigger fires again. Repeatable surveys are unaffected.
(2026-07-22) -
#4205
de3ad61Thanks @posthog! - Warn when session recording masking options inposthog.initshadow the project-level "Privacy and masking" setting. Client-side masking still intentionally takes precedence, but previously the override was silent — a developer could set masking in the dashboard and see it quietly ignored because their SDK config diverged. The recorder now logs a console warning (in debug mode) naming the diverging fields so the precedence is self-explaining.
(2026-07-22) -
Updated dependencies [
0f2407b]:- @posthog/core@1.45.0
- @posthog/types@1.398.0