Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

fix(activity): suppress no-events banner when live feed is showing events (#56317)

posthog[bot]2040d9de56a5
diff --git a/frontend/src/layout/navigation/projectNoticeLogic.tsx b/frontend/src/layout/navigation/projectNoticeLogic.tsx
index 192ef617d328..7bc6e5d41a20 100644
--- a/frontend/src/layout/navigation/projectNoticeLogic.tsx
+++ b/frontend/src/layout/navigation/projectNoticeLogic.tsx
@@ -11,12 +11,14 @@ import { Link } from 'lib/lemon-ui/Link'
import { apiStatusLogic } from 'lib/logic/apiStatusLogic'
import { eventIngestionRestrictionLogic } from 'lib/logic/eventIngestionRestrictionLogic'
import { eventUsageLogic } from 'lib/utils/eventUsageLogic'
+import { liveEventsLogic } from 'scenes/activity/live/liveEventsLogic'
import { verifyEmailLogic } from 'scenes/authentication/signup/verify-email/verifyEmailLogic'
import { billingLogic, BillingAlertConfig } from 'scenes/billing/billingLogic'
import { membersLogic } from 'scenes/organization/membersLogic'
import { organizationLogic } from 'scenes/organizationLogic'
import { preflightLogic } from 'scenes/PreflightCheck/preflightLogic'
import { sceneLogic } from 'scenes/sceneLogic'
+import { Scene } from 'scenes/sceneTypes'
import { ProxyRecord } from 'scenes/settings/environment/proxyLogic'
import { inviteLogic } from 'scenes/settings/organization/inviteLogic'
import { teamLogic } from 'scenes/teamLogic'
@@ -161,6 +163,8 @@ export const projectNoticeLogic = kea<projectNoticeLogicType>([
s.effectiveBillingAlert,
router.selectors.currentLocation,
s.noticeDismissedThisSession,
+ sceneLogic.selectors.activeSceneId,
+ (state) => liveEventsLogic.findMounted()?.selectors.eventCount(state) ?? 0,
],
(
organization,
@@ -174,7 +178,9 @@ export const projectNoticeLogic = kea<projectNoticeLogicType>([
proxyRecords,
effectiveBillingAlert,
currentLocation,
- noticeDismissedThisSession
+ noticeDismissedThisSession,
+ activeSceneId,
+ liveEventCount
): ProjectNoticeVariant | null => {
if (!organization) {
return null
@@ -205,7 +211,11 @@ export const projectNoticeLogic = kea<projectNoticeLogicType>([
} else if (
!isNoticeDismissed('real_project_with_no_events') &&
currentTeam &&
- !currentTeam.ingested_event
+ !currentTeam.ingested_event &&
+ // Belt-and-braces: never claim "no events" while the live activity feed is
+ // actively rendering events on the same screen — `currentTeam.ingested_event`
+ // can lag behind the live SSE stream during the first ingestion window.
+ !(activeSceneId === Scene.LiveEvents && liveEventCount > 0)
) {
return 'real_project_with_no_events'
} else if (hasEventIngestionRestriction) {
diff --git a/frontend/src/scenes/activity/live/liveEventsLogic.tsx b/frontend/src/scenes/activity/live/liveEventsLogic.tsx
index 97a6f2f21149..ba56ef0bc985 100644
--- a/frontend/src/scenes/activity/live/liveEventsLogic.tsx
+++ b/frontend/src/scenes/activity/live/liveEventsLogic.tsx
@@ -23,6 +23,7 @@ export const liveEventsLogic = kea<liveEventsLogicType>([
props({} as LiveEventsLogicProps),
connect(() => ({
values: [teamLogic, ['currentTeam']],
+ actions: [teamLogic, ['loadCurrentTeam']],
})),
actions(() => ({
addEvents: (events: LiveEvent[]) => ({ events }),
@@ -184,6 +185,13 @@ export const liveEventsLogic = kea<liveEventsLogicType>([
const eventProtocol = new URL(eventUrl).protocol
actions.addEventHost(`${eventProtocol}//${eventHost}`)
}
+ // The team's `ingested_event` flag is flipped server-side when the first event is
+ // processed, but only reaches the frontend on the next ~30s team refresh. Refresh
+ // immediately when we observe a live event so banners that depend on the flag
+ // (e.g. the "no events yet" project notice) can't contradict the on-screen feed.
+ if (values.currentTeam && !values.currentTeam.ingested_event) {
+ actions.loadCurrentTeam()
+ }
}
},
})),