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.

chore: Make all notifications archivable (#72253)

Jordan Mryyan44f1c579a61d
diff --git a/frontend/src/layout/navigation-3000/sidepanel/panels/activity/buildNotificationSourcePath.test.ts b/frontend/src/layout/navigation-3000/sidepanel/panels/activity/buildNotificationSourcePath.test.ts
index 9a011f22b1b8..d9b629dff87d 100644
--- a/frontend/src/layout/navigation-3000/sidepanel/panels/activity/buildNotificationSourcePath.test.ts
+++ b/frontend/src/layout/navigation-3000/sidepanel/panels/activity/buildNotificationSourcePath.test.ts
@@ -12,7 +12,6 @@ function makeNotification(overrides: Partial<InAppNotification> = {}): InAppNoti
body: '',
read: false,
read_at: null,
- archivable: false,
resource_type: null,
resource_id: '',
target_type: 'user',
diff --git a/frontend/src/layout/navigation-3000/sidepanel/panels/activity/notificationsSSE.test.ts b/frontend/src/layout/navigation-3000/sidepanel/panels/activity/notificationsSSE.test.ts
index 6e994de9abd2..2d4f5e2c2d5b 100644
--- a/frontend/src/layout/navigation-3000/sidepanel/panels/activity/notificationsSSE.test.ts
+++ b/frontend/src/layout/navigation-3000/sidepanel/panels/activity/notificationsSSE.test.ts
@@ -18,7 +18,6 @@ function makeNotification(overrides: Partial<InAppNotification> = {}): InAppNoti
body: '',
read: false,
read_at: null,
- archivable: false,
resource_type: null,
resource_id: '',
target_type: 'user',
diff --git a/frontend/src/layout/navigation-3000/sidepanel/panels/activity/notificationsSSE.ts b/frontend/src/layout/navigation-3000/sidepanel/panels/activity/notificationsSSE.ts
index b18d37fe58df..469c4846ec42 100644
--- a/frontend/src/layout/navigation-3000/sidepanel/panels/activity/notificationsSSE.ts
+++ b/frontend/src/layout/navigation-3000/sidepanel/panels/activity/notificationsSSE.ts
@@ -32,8 +32,7 @@ export function connectToNotificationsSSE(
hooks.onFirstMessage?.()
}
try {
- const parsed = JSON.parse(event.data) as InAppNotification
- const notification = { ...parsed, archivable: parsed.archivable ?? false }
+ const notification = JSON.parse(event.data) as InAppNotification
onNotification(notification)
} catch {
// Ignore malformed messages
diff --git a/frontend/src/layout/navigation-3000/sidepanel/panels/activity/sidePanelNotificationsLogic.test.ts b/frontend/src/layout/navigation-3000/sidepanel/panels/activity/sidePanelNotificationsLogic.test.ts
index 824a907a19bc..1b43b56de50a 100644
--- a/frontend/src/layout/navigation-3000/sidepanel/panels/activity/sidePanelNotificationsLogic.test.ts
+++ b/frontend/src/layout/navigation-3000/sidepanel/panels/activity/sidePanelNotificationsLogic.test.ts
@@ -25,7 +25,6 @@ function makeNotification(overrides: Partial<InAppNotification> = {}): InAppNoti
created_at: '2026-05-07T12:00:00Z',
read: false,
read_at: null,
- archivable: false,
...overrides,
}
}
@@ -219,7 +218,7 @@ describe('sidePanelNotificationsLogic.archive', () => {
afterEach(() => logic.unmount())
it('removes an archived notification and decrements unread count', async () => {
- const a = makeNotification({ id: 'a', archivable: true, read: false })
+ const a = makeNotification({ id: 'a', read: false })
const b = makeNotification({ id: 'b', resource_id: 'other' })
logic.actions.setInAppNotifications([a, b], false)
logic.actions.setInAppUnreadCount(2)
@@ -228,24 +227,17 @@ describe('sidePanelNotificationsLogic.archive', () => {
expect(logic.values.inAppUnreadCount).toBe(1)
})
- it('does not archive a non-archivable notification', async () => {
- const a = makeNotification({ id: 'a', archivable: false })
- logic.actions.setInAppNotifications([a], false)
- await logic.actions.archiveNotification('a')
- expect(logic.values.inAppNotifications.map((n: InAppNotification) => n.id)).toEqual(['a'])
- })
-
- it('archiveAll removes only archivable notifications', async () => {
- const a = makeNotification({ id: 'a', archivable: true, resource_id: 'a' })
- const b = makeNotification({ id: 'b', archivable: false, resource_id: 'b' })
+ it('archiveAll removes every notification', async () => {
+ const a = makeNotification({ id: 'a', resource_id: 'a' })
+ const b = makeNotification({ id: 'b', resource_id: 'b' })
logic.actions.setInAppNotifications([a, b], false)
await logic.actions.archiveAll()
- expect(logic.values.inAppNotifications.map((n: InAppNotification) => n.id)).toEqual(['b'])
+ expect(logic.values.inAppNotifications).toEqual([])
})
it('archiveAll resyncs the unread count from the server (server value wins)', async () => {
// Optimistic decrement alone would land at 9, but the server is the source of truth.
- const a = makeNotification({ id: 'a', archivable: true, read: false })
+ const a = makeNotification({ id: 'a', read: false })
logic.actions.setInAppNotifications([a], false)
logic.actions.setInAppUnreadCount(10)
await expectLogic(logic, () => {
@@ -253,23 +245,6 @@ describe('sidePanelNotificationsLogic.archive', () => {
}).toDispatchActions(['archiveAll', 'refreshInAppUnreadCount', 'setInAppUnreadCount'])
expect(logic.values.inAppUnreadCount).toBe(1)
})
-
- it('hasArchivableNotifications reflects presence of an archivable notification', () => {
- logic.actions.setInAppNotifications([makeNotification({ id: 'a', archivable: true })], false)
- expect(logic.values.hasArchivableNotifications).toBe(true)
- logic.actions.setInAppNotifications([makeNotification({ id: 'b', archivable: false })], false)
- expect(logic.values.hasArchivableNotifications).toBe(false)
- })
-
- it('group.has_archivable is true when any child is archivable, even if the representative is not', () => {
- // Newest (representative) is non-archivable; an older same-group child is archivable.
- const rep = makeNotification({ id: 'rep', archivable: false, created_at: '2026-05-07T12:00:00Z' })
- const older = makeNotification({ id: 'older', archivable: true, created_at: '2026-05-07T09:00:00Z' })
- logic.actions.setInAppNotifications([rep, older], false)
- const group = logic.values.groups.find((g) => g.count === 2)
- expect(group?.representative.id).toBe('rep')
- expect(group?.has_archivable).toBe(true)
- })
})
describe('sidePanelNotificationsLogic.mainListOffset', () => {
diff --git a/frontend/src/layout/navigation-3000/sidepanel/panels/activity/sidePanelNotificationsLogic.tsx b/frontend/src/layout/navigation-3000/sidepanel/panels/activity/sidePanelNotificationsLogic.tsx
index 1f5c84a173e5..f4221f5c764c 100644
--- a/frontend/src/layout/navigation-3000/sidepanel/panels/activity/sidePanelNotificationsLogic.tsx
+++ b/frontend/src/layout/navigation-3000/sidepanel/panels/activity/sidePanelNotificationsLogic.tsx
@@ -90,7 +90,6 @@ export interface NotificationGroup {
last_seen: string
children: InAppNotification[]
has_unread: boolean
- has_archivable: boolean
full_children_loaded: boolean
}
@@ -119,9 +118,6 @@ export function buildGroups(notifications: InAppNotification[], loadedGroupKeys:
if (!n.read) {
existing.has_unread = true
}
- if (n.archivable) {
- existing.has_archivable = true
- }
continue
}
byKey.set(key, {
@@ -132,7 +128,6 @@ export function buildGroups(notifications: InAppNotification[], loadedGroupKeys:
last_seen: n.created_at,
children: [n],
has_unread: !n.read,
- has_archivable: n.archivable,
full_children_loaded: loadedGroupKeys.has(key),
})
groups.push(byKey.get(key)!)
@@ -1016,7 +1011,7 @@ export const sidePanelNotificationsLogic = kea<sidePanelNotificationsLogicType>(
},
archiveNotification: async ({ id }) => {
const notification = values.inAppNotifications.find((n) => n.id === id)
- if (!notification || !notification.archivable) {
+ if (!notification) {
return
}
actions.removeNotifications([id])
@@ -1040,12 +1035,11 @@ export const sidePanelNotificationsLogic = kea<sidePanelNotificationsLogicType>(
if (!refreshed) {
return
}
- const archivable = refreshed.children.filter((c) => c.archivable)
- const ids = archivable.map((c) => c.id)
+ const ids = refreshed.children.map((c) => c.id)
if (ids.length === 0) {
return
}
- const unreadArchived = archivable.filter((c) => !c.read).length
+ const unreadArchived = refreshed.children.filter((c) => !c.read).length
actions.removeNotifications(ids)
if (unreadArchived > 0) {
actions.setInAppUnreadCount(Math.max(0, values.inAppUnreadCount - unreadArchived))
@@ -1060,12 +1054,11 @@ export const sidePanelNotificationsLogic = kea<sidePanelNotificationsLogicType>(
await actions.refreshInAppUnreadCount()
},
archiveAll: async () => {
- const archivable = values.inAppNotifications.filter((n) => n.archivable)
- const ids = archivable.map((n) => n.id)
+ const ids = values.inAppNotifications.map((n) => n.id)
if (ids.length === 0) {
return
}
- const unreadArchived = archivable.filter((n) => !n.read).length
+ const unreadArchived = values.inAppNotifications.filter((n) => !n.read).length
actions.removeNotifications(ids)
if (unreadArchived > 0) {
actions.setInAppUnreadCount(Math.max(0, values.inAppUnreadCount - unreadArchived))
@@ -1247,7 +1240,7 @@ export const sidePanelNotificationsLogic = kea<sidePanelNotificationsLogicType>(
],
hasArchivableNotifications: [
(s) => [s.inAppNotifications],
- (inAppNotifications: InAppNotification[]): boolean => inAppNotifications.some((n) => n.archivable),
+ (inAppNotifications: InAppNotification[]): boolean => inAppNotifications.length > 0,
],
unreadCount: [
(s) => [s.realTimeNotificationsEnabled, s.legacyNotifications, s.inAppUnreadCount],
diff --git a/frontend/src/lib/components/NotificationsMenu/NotificationGroupRow.tsx b/frontend/src/lib/components/NotificationsMenu/NotificationGroupRow.tsx
index 7f4455bd73ca..969b7a78e8e6 100644
--- a/frontend/src/lib/components/NotificationsMenu/NotificationGroupRow.tsx
+++ b/frontend/src/lib/components/NotificationsMenu/NotificationGroupRow.tsx
@@ -139,7 +139,7 @@ export function NotificationGroupRow({
allRead={allRead}
expanded={isExpanded}
readOnly={readOnly}
- hasArchivable={archivingEnabled && group.has_archivable}
+ hasArchivable={archivingEnabled}
onToggleRead={handleToggleRead}
onToggleExpand={handleExpand}
onArchive={handleArchive}
diff --git a/frontend/src/lib/components/NotificationsMenu/NotificationRow.tsx b/frontend/src/lib/components/NotificationsMenu/NotificationRow.tsx
index 70442360d5ef..3d7deb08bf6a 100644
--- a/frontend/src/lib/components/NotificationsMenu/NotificationRow.tsx
+++ b/frontend/src/lib/components/NotificationsMenu/NotificationRow.tsx
@@ -218,7 +218,7 @@ export function NotificationRow({
</div>
</div>
<div className={`absolute bottom-1.5 right-1.5 flex items-center gap-1 ${ROW_ACTION_REVEAL_CLASSES}`}>
- {archivingEnabled && !readOnly && notification.archivable && (
+ {archivingEnabled && !readOnly && (
<NotificationActionButton
icon={<IconArchive className="size-4" />}
tooltip="Archive"
diff --git a/frontend/src/types.ts b/frontend/src/types.ts
index cd93713aad31..c4869915247c 100644
--- a/frontend/src/types.ts
+++ b/frontend/src/types.ts
@@ -483,7 +483,6 @@ export interface InAppNotification {
body: string
read: boolean
read_at: string | null
- archivable: boolean
resource_type: string | null
resource_id: string
target_type: string
diff --git a/products/notifications/backend/facade/contracts.py b/products/notifications/backend/facade/contracts.py
index 028b8fb0106e..e92bae31e8ae 100644
--- a/products/notifications/backend/facade/contracts.py
+++ b/products/notifications/backend/facade/contracts.py
@@ -31,6 +31,5 @@ class NotificationData:
source_type: SourceType | None = None
source_id: str | None = None
priority: Priority = Priority.NORMAL
- archivable: bool = False
metadata: dict[str, Any] | None = None
resolver: RecipientsResolver | None = field(default=None, compare=False)
diff --git a/products/notifications/backend/logic.py b/products/notifications/backend/logic.py
index f8856121de8a..ac74170c75f6 100644
--- a/products/notifications/backend/logic.py
+++ b/products/notifications/backend/logic.py
@@ -39,7 +39,6 @@ def _publish_to_kafka(event: NotificationEvent) -> None:
"source_url": event.source_url,
"source_type": event.source_type,
"source_id": event.source_id,
- "archivable": event.archivable,
"resolved_user_ids": event.resolved_user_ids,
"created_at": event.created_at.isoformat(),
},
@@ -216,7 +215,6 @@ def create_notification(data: NotificationData) -> NotificationEvent | None:
source_id=data.source_id,
target_type=data.target_type,
target_id=data.target_id,
- archivable=data.archivable,
resolved_user_ids=resolved_user_ids,
metadata=data.metadata,
)
diff --git a/products/notifications/backend/migrations/0019_remove_notificationevent_archivable.py b/products/notifications/backend/migrations/0019_remove_notificationevent_archivable.py
new file mode 100644
index 000000000000..b8a960dbce1b
--- /dev/null
+++ b/products/notifications/backend/migrations/0019_remove_notificationevent_archivable.py
@@ -0,0 +1,18 @@
+from django.db import migrations
+
+
+class Migration(migrations.Migration):
+ dependencies = [
+ ("notifications", "0018_alter_notificationevent_notification_type"),
+ ]
+
+ operations = [
+ migrations.SeparateDatabaseAndState(
+ state_operations=[
+ migrations.RemoveField(
+ model_name="notificationevent",
+ name="archivable",
+ ),
+ ],
+ ),
+ ]
diff --git a/products/notifications/backend/migrations/max_migration.txt b/products/notifications/backend/migrations/max_migration.txt
index b3d74acdbf7f..143e7c56a201 100644
--- a/products/notifications/backend/migrations/max_migration.txt
+++ b/products/notifications/backend/migrations/max_migration.txt
@@ -1 +1 @@
-0018_alter_notificationevent_notification_type
+0019_remove_notificationevent_archivable
diff --git a/products/notifications/backend/models.py b/products/notifications/backend/models.py
index f17823ef3c3a..334950d5673c 100644
--- a/products/notifications/backend/models.py
+++ b/products/notifications/backend/models.py
@@ -20,7 +20,6 @@ class NotificationEvent(UUIDModel):
target_type = models.CharField(max_length=16, choices=[(t.value, t.name) for t in TargetType])
target_id = models.CharField(max_length=64)
resolved_user_ids = models.JSONField(default=list)
- archivable = models.BooleanField(default=False, db_default=False)
metadata = models.JSONField(null=True, blank=True, default=None)
created_at = models.DateTimeField(auto_now_add=True)
diff --git a/products/notifications/backend/presentation/serializers.py b/products/notifications/backend/presentation/serializers.py
index b4cedd985bdc..9e5355f43988 100644
--- a/products/notifications/backend/presentation/serializers.py
+++ b/products/notifications/backend/presentation/serializers.py
@@ -19,10 +19,6 @@ class NotificationEventSerializer(serializers.Serializer):
body = serializers.CharField()
read = serializers.BooleanField()
read_at = serializers.DateTimeField(allow_null=True)
- archivable = serializers.BooleanField(
- help_text="Whether this notification opted in to being archived (dismissed) by the recipient. "
- "When false, the notification only supports read/unread."
- )
target_type = serializers.CharField()
target_id = serializers.CharField()
resource_type = serializers.CharField(allow_null=True)
diff --git a/products/notifications/backend/presentation/views.py b/products/notifications/backend/presentation/views.py
index e8d9b8e36b43..3fa5f889cc56 100644
--- a/products/notifications/backend/presentation/views.py
+++ b/products/notifications/backend/presentation/views.py
@@ -364,9 +364,8 @@ class NotificationsViewSet(TeamAndOrgViewSetMixin, GenericViewSet):
user = self._get_user()
event = self._get_recipient_event_or_404()
- if event.archivable:
- NotificationArchiveState.objects.get_or_create(notification_event=event, user=user)
- invalidate_unread_count(user.id, self.team.organization_id)
+ NotificationArchiveState.objects.get_or_create(notification_event=event, user=user)
+ invalidate_unread_count(user.id, self.team.organization_id)
return Response({"status": "ok"})
@validated_request(request_serializer=BulkNotificationIdsRequestSerializer)
@@ -385,7 +384,6 @@ class NotificationsViewSet(TeamAndOrgViewSetMixin, GenericViewSet):
id__in=ids, # nosemgrep: idor-taint-user-input-to-model-get
organization_id=self.team.organization_id,
resolved_user_ids__contains=[user.id],
- archivable=True,
).values_list("id", flat=True)
)
if eligible_ids:
@@ -401,7 +399,7 @@ class NotificationsViewSet(TeamAndOrgViewSetMixin, GenericViewSet):
return Response({"updated": 0})
user = self._get_user()
- queryset = self._get_base_queryset().filter(archivable=True, archived=False)
+ queryset = self._get_base_queryset().filter(archived=False)
event_ids = list(queryset.values_list("id", flat=True))
if event_ids:
archive_states = [NotificationArchiveState(notification_event_id=eid, user=user) for eid in event_ids]
diff --git a/products/notifications/backend/tests/test_api.py b/products/notifications/backend/tests/test_api.py
index f78fb4543e99..5722f4c0de0c 100644
--- a/products/notifications/backend/tests/test_api.py
+++ b/products/notifications/backend/tests/test_api.py
@@ -420,7 +420,7 @@ class TestNotificationsAPI(BaseTest):
)
assert resp.status_code == 400
- def _create_archivable(self, title: str = "Archivable") -> NotificationEvent:
+ def _create_notification(self, title: str = "Extra") -> NotificationEvent:
return NotificationEvent.objects.create(
organization=self.organization,
team=self.team,
@@ -430,29 +430,16 @@ class TestNotificationsAPI(BaseTest):
target_type="user",
target_id=str(self.user.id),
resolved_user_ids=[self.user.id],
- archivable=True,
)
- def test_serializer_exposes_archivable(self):
- self._create_archivable()
- resp = self.client.get(f"/api/environments/{self.team.id}/notifications/")
- by_title = {r["title"]: r for r in resp.json()["results"]}
- assert by_title["Archivable"]["archivable"] is True
- assert by_title["Test notification"]["archivable"] is False
-
- def test_archive_archivable_notification(self):
- event = self._create_archivable()
+ def test_archive_notification(self):
+ event = self._create_notification()
resp = self.client.post(f"/api/environments/{self.team.id}/notifications/{event.id}/archive/")
assert resp.status_code == 200
assert NotificationArchiveState.objects.filter(notification_event=event, user=self.user).exists()
- def test_archive_is_noop_for_non_archivable(self):
- resp = self.client.post(f"/api/environments/{self.team.id}/notifications/{self.event.id}/archive/")
- assert resp.status_code == 200
- assert not NotificationArchiveState.objects.filter(notification_event=self.event, user=self.user).exists()
-
def test_archived_notification_excluded_from_list(self):
- event = self._create_archivable()
+ event = self._create_notification()
NotificationArchiveState.objects.create(notification_event=event, user=self.user)
resp = self.client.get(f"/api/environments/{self.team.id}/notifications/")
ids = {r["id"] for r in resp.json()["results"]}
@@ -460,9 +447,9 @@ class TestNotificationsAPI(BaseTest):
assert str(self.event.id) in ids
def test_archived_list_returns_only_archived(self):
- archived = self._create_archivable("Archived item")
+ archived = self._create_notification("Archived item")
NotificationArchiveState.objects.create(notification_event=archived, user=self.user)
- active = self._create_archivable("Still active")
+ active = self._create_notification("Still active")
resp = self.client.get(f"/api/environments/{self.team.id}/notifications/?archived=true")
ids = {r["id"] for r in resp.json()["results"]}
assert str(archived.id) in ids
@@ -470,29 +457,30 @@ class TestNotificationsAPI(BaseTest):
assert str(self.event.id) not in ids
def test_archived_notification_excluded_from_unread_count(self):
- event = self._create_archivable()
+ event = self._create_notification()
NotificationArchiveState.objects.create(notification_event=event, user=self.user)
resp = self.client.get(f"/api/environments/{self.team.id}/notifications/unread_count/")
assert resp.json()["count"] == 1
def test_archive_invalidates_cache(self):
- event = self._create_archivable()
+ event = self._create_notification()
cache_key = _unread_count_cache_key(self.user.id, self.organization.id)
cache.set(cache_key, 5, 60)
self.client.post(f"/api/environments/{self.team.id}/notifications/{event.id}/archive/")
assert cache.get(cache_key) is None
- def test_archive_bulk_only_archives_archivable(self):
- archivable = self._create_archivable("Bulk archivable")
+ def test_archive_bulk(self):
+ a1 = self._create_notification("Bulk 1")
+ a2 = self._create_notification("Bulk 2")
resp = self.client.post(
f"/api/environments/{self.team.id}/notifications/archive_bulk/",
- {"notification_ids": [str(archivable.id), str(self.event.id)]},
+ {"notification_ids": [str(a1.id), str(a2.id)]},
format="json",
)
assert resp.status_code == 200
- assert resp.json()["updated"] == 1
- assert NotificationArchiveState.objects.filter(notification_event=archivable, user=self.user).exists()
- assert not NotificationArchiveState.objects.filter(notification_event=self.event, user=self.user).exists()
+ assert resp.json()["updated"] == 2
+ for ev in (a1, a2):
+ assert NotificationArchiveState.objects.filter(notification_event=ev, user=self.user).exists()
def test_archive_bulk_skips_non_recipient(self):
other_event = NotificationEvent.objects.create(
@@ -504,7 +492,6 @@ class TestNotificationsAPI(BaseTest):
target_type="user",
target_id="999",
resolved_user_ids=[],
- archivable=True,
)
resp = self.client.post(
f"/api/environments/{self.team.id}/notifications/archive_bulk/",
@@ -525,26 +512,23 @@ class TestNotificationsAPI(BaseTest):
target_type="user",
target_id="999",
resolved_user_ids=[],
- archivable=True,
)
resp = self.client.post(f"/api/environments/{self.team.id}/notifications/{other_event.id}/archive/")
assert resp.status_code == 404
assert not NotificationArchiveState.objects.filter(notification_event=other_event, user=self.user).exists()
- def test_archive_all_only_archives_archivable(self):
- a1 = self._create_archivable("A1")
- a2 = self._create_archivable("A2")
+ def test_archive_all(self):
+ a1 = self._create_notification("A1")
+ a2 = self._create_notification("A2")
resp = self.client.post(f"/api/environments/{self.team.id}/notifications/archive_all/")
assert resp.status_code == 200
- assert resp.json()["updated"] == 2
- assert NotificationArchiveState.objects.filter(user=self.user).count() == 2
- assert not NotificationArchiveState.objects.filter(notification_event=self.event, user=self.user).exists()
- for ev in (a1, a2):
+ assert resp.json()["updated"] == 3
+ for ev in (self.event, a1, a2):
assert NotificationArchiveState.objects.filter(notification_event=ev, user=self.user).exists()
def test_archive_is_per_user(self):
other_user = User.objects.create_and_join(self.organization, "[email protected]", "password")
- event = self._create_archivable()
+ event = self._create_notification()
NotificationEvent.objects.filter(pk=event.pk).update(resolved_user_ids=[self.user.id, other_user.id])
self.client.post(f"/api/environments/{self.team.id}/notifications/{event.id}/archive/")
diff --git a/products/notifications/backend/tests/test_logic.py b/products/notifications/backend/tests/test_logic.py
index 8908345dc66a..3ff59bae868c 100644
--- a/products/notifications/backend/tests/test_logic.py
+++ b/products/notifications/backend/tests/test_logic.py
@@ -47,27 +47,8 @@ class TestCreateNotification(BaseTest):
assert event.resolved_user_ids == [self.user.id]
assert event.organization_id == self.organization.id
assert event.notification_type == "comment_mention"
- assert event.archivable is False
assert NotificationEvent.objects.count() == 1
- @patch("products.notifications.backend.logic.posthoganalytics.feature_enabled", return_value=True)
- @patch("products.notifications.backend.logic._publish_to_kafka")
- def test_create_notification_archivable(self, mock_publish, mock_ff):
- data = NotificationData(
- team_id=self.team.id,
- notification_type=NotificationType.COMMENT_MENTION,
- title="Archivable notification",
- body="Test body",
- target_type=TargetType.USER,
- target_id=str(self.user.id),
- archivable=True,
- )
- event = create_notification(data)
-
- assert event is not None
- assert event.archivable is True
- assert NotificationEvent.objects.get(id=event.id).archivable is True
-
@patch("products.notifications.backend.logic.posthoganalytics.feature_enabled", return_value=True)
@patch("products.notifications.backend.logic._publish_to_kafka")
def test_create_notification_for_organization(self, mock_publish, mock_ff):
diff --git a/products/notifications/frontend/generated/api.schemas.ts b/products/notifications/frontend/generated/api.schemas.ts
index 94779ec6d436..291ed4e31249 100644
--- a/products/notifications/frontend/generated/api.schemas.ts
+++ b/products/notifications/frontend/generated/api.schemas.ts
@@ -50,8 +50,6 @@ export interface NotificationEventApi {
read: boolean
/** @nullable */
read_at: string | null
- /** Whether this notification opted in to being archived (dismissed) by the recipient. When false, the notification only supports read/unread. */
- archivable: boolean
target_type: string
target_id: string
/** @nullable */
diff --git a/products/web_analytics/backend/achievements/tasks.py b/products/web_analytics/backend/achievements/tasks.py
index 6d467d345c0d..3546a22b23b0 100644
--- a/products/web_analytics/backend/achievements/tasks.py
+++ b/products/web_analytics/backend/achievements/tasks.py
@@ -253,7 +253,6 @@ def _send_unlock_notification(ctx: EvalContext, track: TrackDefinition, stage: i
target_type=target_type,
target_id=target_id,
priority=Priority.NORMAL,
- archivable=True,
source_url=f"/project/{ctx.team.id}/web",
)
)
diff --git a/products/web_analytics/backend/temporal/digest_notification/activities.py b/products/web_analytics/backend/temporal/digest_notification/activities.py
index 3d61bd648611..a01b123eab2a 100644
--- a/products/web_analytics/backend/temporal/digest_notification/activities.py
+++ b/products/web_analytics/backend/temporal/digest_notification/activities.py
@@ -238,7 +238,6 @@ def _send_digest_notification(
target_id=str(user.id),
resource_type="web_analytics",
priority=Priority.NORMAL,
- archivable=True,
source_url=f"/project/{busiest_team_id}/web?utm_source=web_analytics_digest&utm_medium=in_app",
metadata=_build_digest_metadata(busiest),
)
diff --git a/products/web_analytics/backend/test/test_achievements_tasks.py b/products/web_analytics/backend/test/test_achievements_tasks.py
index a02f48ded109..1ea8c40441b7 100644
--- a/products/web_analytics/backend/test/test_achievements_tasks.py
+++ b/products/web_analytics/backend/test/test_achievements_tasks.py
@@ -93,7 +93,6 @@ class TestRecomputeTask(BaseTest):
with self.captureOnCommitCallbacks(execute=True):
self._run_user(make_evaluators(loyal_days=lambda ctx: 5))
self.assertEqual(mock_notify.call_count, 1)
- self.assertTrue(mock_notify.call_args.args[0].archivable)
def test_unlock_notification_skipped_when_achievements_flag_disabled(self) -> None:
with patch("posthoganalytics.feature_enabled", return_value=False):
diff --git a/products/web_analytics/backend/test/test_digest_notification_activities.py b/products/web_analytics/backend/test/test_digest_notification_activities.py
index 587ffdab1b3c..1cbc97c814f2 100644
--- a/products/web_analytics/backend/test/test_digest_notification_activities.py
+++ b/products/web_analytics/backend/test/test_digest_notification_activities.py
@@ -106,7 +106,6 @@ class TestBuildAndSendForOrg(_DigestNotificationTestBase):
assert data.target_id == str(self.user.id)
assert data.team_id == self.team.id
assert data.resource_type == "web_analytics"
- assert data.archivable is True
assert "utm_source=web_analytics_digest" in data.source_url
def test_test_arm_records_exposure_and_captures_sent_event(self):
diff --git a/services/mcp/src/api/generated.ts b/services/mcp/src/api/generated.ts
index 92ede429c9ae..90c9eab7c7c3 100644
--- a/services/mcp/src/api/generated.ts
+++ b/services/mcp/src/api/generated.ts
@@ -39264,8 +39264,6 @@ export namespace Schemas {
read: boolean;
/** @nullable */
read_at: string | null;
- /** Whether this notification opted in to being archived (dismissed) by the recipient. When false, the notification only supports read/unread. */
- archivable: boolean;
target_type: string;
target_id: string;
/** @nullable */