: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.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
fix(file-system): expose entry creator (#74282)
Shy Alterece86e0f0dad
diff --git a/frontend/src/generated/core/api.schemas.ts b/frontend/src/generated/core/api.schemas.tsindex 8841446e04e5..3031e5ef8cde 100644--- a/frontend/src/generated/core/api.schemas.ts+++ b/frontend/src/generated/core/api.schemas.ts@@ -2759,6 +2759,7 @@ export interface FileSystemApi {/** @nullable */shortcut?: boolean | nullreadonly created_at: string+ readonly created_by: UserBasicApi | null/** @nullable */readonly last_viewed_at: string | null/**@@ -2795,6 +2796,7 @@ export interface PatchedFileSystemApi {/** @nullable */shortcut?: boolean | nullreadonly created_at?: string+ readonly created_by?: UserBasicApi | null/** @nullable */readonly last_viewed_at?: string | null/**diff --git a/posthog/api/file_system/file_system.py b/posthog/api/file_system/file_system.pyindex 6a2c0826547a..cd438913d0d3 100644--- a/posthog/api/file_system/file_system.py+++ b/posthog/api/file_system/file_system.py@@ -77,6 +77,7 @@ RECENTS_SEARCH_SCAN_LIMIT = 200class FileSystemSerializer(FileSystemAccessLevelSerializerMixin, serializers.ModelSerializer):last_viewed_at = serializers.DateTimeField(read_only=True, allow_null=True)+ created_by = UserBasicSerializer(read_only=True, allow_null=True)class Meta:model = FileSystem@@ -90,6 +91,7 @@ class FileSystemSerializer(FileSystemAccessLevelSerializerMixin, serializers.Mod"meta","shortcut","created_at",+ "created_by","last_viewed_at","user_access_level",]diff --git a/posthog/api/file_system/test/test_file_system.py b/posthog/api/file_system/test/test_file_system.pyindex 55962fa1050b..8df18e048dfa 100644--- a/posthog/api/file_system/test/test_file_system.py+++ b/posthog/api/file_system/test/test_file_system.py@@ -2097,6 +2097,20 @@ class TestDesktopFileSystemSurface(APIBaseTest):# Both the leaf and the auto-created parent folder are stamped "desktop".self.assertEqual(surfaces, {"desktop"})+ def test_desktop_list_returns_creator(self):+ self.client.post(self.desktop_url, {"path": "Folder/Item", "type": "doc"})++ [item] = [item for item in self.client.get(self.desktop_url).json()["results"] if item["type"] == "doc"]++ self.assertEqual(item["created_by"]["uuid"], str(self.user.uuid))++ def test_desktop_list_returns_null_for_deleted_creator(self):+ FileSystem.objects.create(team=self.team, path="Orphaned item", type="doc", surface="desktop", created_by=None)++ [item] = self.client.get(self.desktop_url).json()["results"]++ self.assertIsNone(item["created_by"])+def test_legacy_null_rows_appear_on_web_route_only(self):FileSystem.objects.create(team=self.team, path="Legacy", type="doc", surface=None, created_by=self.user)diff --git a/services/mcp/src/api/generated.ts b/services/mcp/src/api/generated.tsindex 69a78ebf499b..c3610d8248b6 100644--- a/services/mcp/src/api/generated.ts+++ b/services/mcp/src/api/generated.ts@@ -31770,6 +31770,7 @@ export namespace Schemas {/** @nullable */shortcut?: boolean | null;readonly created_at: string;+ readonly created_by: UserBasic | null;/** @nullable */readonly last_viewed_at: string | null;/**@@ -49249,6 +49250,7 @@ export namespace Schemas {/** @nullable */shortcut?: boolean | null;readonly created_at?: string;+ readonly created_by?: UserBasic | null;/** @nullable */readonly last_viewed_at?: string | null;/**