From 01fa47dd8d77c4bc3fc95d70abd6e8020cd3d551 Mon Sep 17 00:00:00 2001 From: kirtimanmishrazipstack Date: Fri, 19 Jun 2026 17:26:09 +0530 Subject: [PATCH 1/4] UN-3578 [FIX] Keep GDrive folder listing alive when a Google-native file lacks a size Co-Authored-By: Claude Opus 4.8 (1M context) --- backend/file_management/file_management_helper.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/backend/file_management/file_management_helper.py b/backend/file_management/file_management_helper.py index ab56c4dba5..d887de5c7a 100644 --- a/backend/file_management/file_management_helper.py +++ b/backend/file_management/file_management_helper.py @@ -81,9 +81,16 @@ def get_files(fs: AbstractFileSystem, file_path: str) -> list[FileInformation]: if os.path.normpath(file_path) == os.path.normpath(file_name): continue - # Call fs.info() to get file size if its missing + # Backfill missing size via fs.info(). pydrive2 raises int(None) on + # Google-native docs (no fileSize); fall back to 0, don't fail the listing. if file_info.get("type") == "file" and file_info.get("size") is None: - file_info = fs.info(file_name) + try: + file_info = fs.info(file_name) + except Exception: + logger.warning( + "fs.info() failed for %s; using ls() metadata", file_name + ) + file_info["size"] = 0 file_content_type = file_info.get("ContentType") if not file_content_type: From c208e1c0a0dfe3f00ba0ee6d05510cd612f5c787 Mon Sep 17 00:00:00 2001 From: kirtimanmishrazipstack Date: Fri, 19 Jun 2026 17:42:25 +0530 Subject: [PATCH 2/4] UN-3578 [FIX] Log fs.info() failure cause in GDrive listing fallback Co-Authored-By: Claude Opus 4.8 (1M context) --- backend/file_management/file_management_helper.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/backend/file_management/file_management_helper.py b/backend/file_management/file_management_helper.py index d887de5c7a..c77fe63687 100644 --- a/backend/file_management/file_management_helper.py +++ b/backend/file_management/file_management_helper.py @@ -86,9 +86,11 @@ def get_files(fs: AbstractFileSystem, file_path: str) -> list[FileInformation]: if file_info.get("type") == "file" and file_info.get("size") is None: try: file_info = fs.info(file_name) - except Exception: + except Exception as exc: logger.warning( - "fs.info() failed for %s; using ls() metadata", file_name + "fs.info() failed for %s; using ls() metadata: %s", + file_name, + exc, ) file_info["size"] = 0 From 68b504b199981f2468f5284738b466609676236f Mon Sep 17 00:00:00 2001 From: kirtimanmishrazipstack Date: Sat, 20 Jun 2026 13:36:15 +0530 Subject: [PATCH 3/4] UN-3578 [MISC] Document size=0 fallback rationale in GDrive folder listing Co-Authored-By: Claude Opus 4.8 --- backend/file_management/file_management_helper.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/file_management/file_management_helper.py b/backend/file_management/file_management_helper.py index c77fe63687..008368d09d 100644 --- a/backend/file_management/file_management_helper.py +++ b/backend/file_management/file_management_helper.py @@ -81,8 +81,8 @@ def get_files(fs: AbstractFileSystem, file_path: str) -> list[FileInformation]: if os.path.normpath(file_path) == os.path.normpath(file_name): continue - # Backfill missing size via fs.info(). pydrive2 raises int(None) on - # Google-native docs (no fileSize); fall back to 0, don't fail the listing. + # Google-native docs (Docs/Sheets/Slides) carry no fileSize, so pydrive2's + # info() raises on int(None); fall back to 0 (display-only) to keep listing. if file_info.get("type") == "file" and file_info.get("size") is None: try: file_info = fs.info(file_name) From 6b32b5fadd12262f76d75273d6e8a49c85cd45ec Mon Sep 17 00:00:00 2001 From: kirtimanmishrazipstack Date: Sat, 20 Jun 2026 14:00:06 +0530 Subject: [PATCH 4/4] UN-3578 [FIX] Show blank instead of 0 B for unknown file size in connector browser Google-native docs report no size; the folder browser now leaves the size field blank rather than asserting a misleading 0 B. Display-only; applies uniformly across all file connectors. Co-Authored-By: Claude Opus 4.8 --- .../src/components/input-output/file-system/FileSystem.jsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/input-output/file-system/FileSystem.jsx b/frontend/src/components/input-output/file-system/FileSystem.jsx index 2ce90ef485..3380abcde9 100644 --- a/frontend/src/components/input-output/file-system/FileSystem.jsx +++ b/frontend/src/components/input-output/file-system/FileSystem.jsx @@ -204,7 +204,8 @@ function transformTree(tree) { title = key.split("/").at(-1); isFile = node.type === "file"; modifiedDate = node.modified_at?.split(" ")[0] || ""; - size = isFile ? formatBytes(node.size) : ""; + // Blank when size is 0/unknown (e.g. Google-native docs) instead of "0 B". + size = isFile && node.size ? formatBytes(node.size) : ""; node["key"] = key; node["icon"] = isFile ? : ;