)]}'
{
  "commit": "aac691b0a4dfada7f8848e1dab9551a020b5adb3",
  "tree": "a2c08ddf69c89c39794cafc4c89a3fa671a19702",
  "parents": [
    "46811cabb180dec9a36586fe32cb69857ecbb035"
  ],
  "author": {
    "name": "Yash R Hosalli",
    "email": "hosalliyash@gmail.com",
    "time": "Tue Apr 21 02:35:37 2026 +0530"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Mon Apr 20 21:05:37 2026 +0000"
  },
  "message": "Added size support to Network tab (#9744)\n\n## Overview\r\n\r\nThis PR adds support for displaying response payload size in the Network tab\r\nand fixes #6165.\r\n\r\nIt introduces a new **\"Size\"** column in the network requests table and displays response size in the **Overview panel** of the request inspector.\r\n\r\n---\r\n\r\n## Changes\r\n\r\n### 1. Data Model Updates\r\n\r\n**File:**\r\n`packages/devtools_app/lib/src/screens/network/network_model.dart`\r\n\r\n* Added two new getters to the `NetworkRequest` base class:\r\n\r\n  * `requestBytes`\r\n  * `responseBytes`\r\n* Implemented these getters in the `Socket` class using:\r\n\r\n  * `writeBytes` : request size\r\n  * `readBytes` : response size\r\n\r\n**Purpose:**\r\nExpose byte-level data in a unified way for all network request types.\r\n\r\n---\r\n\r\n### 2. HTTP Data Handling\r\n\r\n**File:**\r\n`packages/devtools_app/lib/src/shared/http/http_request_data.dart`\r\n\r\n* Added logic to extract response size using the `content-length` header\r\n* Handles both `String` and `List\u003cString\u003e` header formats\r\n\r\n**Purpose:**\r\nProvide response size for HTTP requests when available, without requiring changes to the Dart VM.\r\n\r\n---\r\n\r\n### 3. Shared Utility\r\n\r\n**File:**\r\n`packages/devtools_app/lib/src/screens/network/utils/http_utils.dart`\r\n\r\n* Moved `formatBytes` into a reusable utility function\r\n* Uses **decimal (base-10) units** (`kB`, `MB`) to align with Chrome DevTools\r\n* Handles null and negative values safely\r\n\r\n**Purpose:**\r\nEnsure consistent formatting across the network table and inspector views.\r\n\r\n---\r\n\r\n### 4. Network Table UI\r\n\r\n**File:**\r\n`packages/devtools_app/lib/src/screens/network/network_screen.dart`\r\n\r\n* Added a new column: **\"Size\"**\r\n* Displays formatted response size\r\n* Shows `-` when size is unavailable\r\n\r\n---\r\n\r\n### 5. Request Inspector (Overview Panel)\r\n\r\n**File:**\r\n`packages/devtools_app/lib/src/screens/network/network_request_inspector_views.dart`\r\n\r\n* Added a new row:\r\n\r\n  * **Response Size**\r\n* Uses shared `formatBytes` utility\r\n\r\n---\r\n\r\n### 6. Tests\r\n\r\n* Added unit tests for:\r\n\r\n  * `formatBytes` utility in `http_utils_test.dart`\r\n  * `responseBytes` parsing logic in `http_request_data.dart`\r\n* Covers edge cases including:\r\n\r\n  * string and list headers\r\n  * invalid values\r\n  * null handling\r\n\r\n---\r\n\r\n## Why request size is not included\r\n\r\nRequest size is not reliably available for HTTP requests due to limitations in the current DevTools and VM service APIs:\r\n\r\n* The Dart VM does not expose request payload size in `HttpProfileRequest`\r\n* HTTP request bodies are not always accessible or fully captured\r\n* Headers such as `content-length` are often absent for outgoing requests\r\n* Streaming and chunked requests complicate accurate measurement\r\n\r\nWhile socket-level request size (`writeBytes`) is available, it is not consistently applicable to HTTP requests.\r\n\r\nTherefore, including request size would require changes in the Dart SDK / VM layer.\r\n\r\nThis PR focuses on **response size**, which can be reliably determined using:\r\n\r\n* Socket `readBytes`\r\n* HTTP `content-length` header (when present)\r\n\r\n---\r\n\r\n## Screenshot\r\n\r\n\u003cimg width\u003d\"1359\" height\u003d\"882\" alt\u003d\"Screenshot 2026-03-27 233804\" src\u003d\"https://github.com/user-attachments/assets/4ddce5eb-1a4b-4a9e-80b6-cd16fa226c13\" /\u003e\r\n\r\n---\r\n\r\n## Future Work\r\n\r\n* Add request size support when VM-level data becomes available\r\n* Introduce separate request/response size columns\r\n* Improve accuracy via VM instrumentation\r\n\r\n---\r\n\r\n### General checklist\r\n\r\n* [x] I read the Contributor Guide\r\n* [x] I read the Tree Hygiene guidelines\r\n* [x] I followed the Flutter Style Guide\r\n* [x] I signed the CLA\r\n* [x] I updated relevant documentation\r\n\r\n---\r\n\r\n### Issues checklist\r\n\r\n* [x] This PR fixes #6165\r\n\r\n---\r\n\r\n### Tests checklist\r\n\r\n* [x] Added unit tests for new functionality\r\n\r\n---\r\n\r\n### AI-tooling checklist\r\n\r\n* [x] I used AI tooling responsibly and verified all generated content\r\n\r\n---\r\n\r\n### Feature-change checklist\r\n\r\n* [x] This PR changes DevTools UI\r\n* [x] Added entry to `NEXT_RELEASE_NOTES.md`\r\n* [x] Included screenshots\r\n* [x] Verified changes locally",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "8a6697fbe652c9b68c7d4ddc3e56e46ea5dc08b1",
      "old_mode": 33188,
      "old_path": "packages/devtools_app/lib/src/screens/network/network_model.dart",
      "new_id": "9ccc3c5217acaf2de7fbffa7435a27e10b053ab0",
      "new_mode": 33188,
      "new_path": "packages/devtools_app/lib/src/screens/network/network_model.dart"
    },
    {
      "type": "modify",
      "old_id": "e9bf905f7113052d543e50411ef1fc91c918b180",
      "old_mode": 33188,
      "old_path": "packages/devtools_app/lib/src/screens/network/network_request_inspector_views.dart",
      "new_id": "118f76c29fdcf46ae46ced43658863f902ef773b",
      "new_mode": 33188,
      "new_path": "packages/devtools_app/lib/src/screens/network/network_request_inspector_views.dart"
    },
    {
      "type": "modify",
      "old_id": "0320b51fd508d1892ec9da495eb16da4d5443b6c",
      "old_mode": 33188,
      "old_path": "packages/devtools_app/lib/src/screens/network/network_screen.dart",
      "new_id": "a9358f30f0411978c9028f0f7f387180eaebc628",
      "new_mode": 33188,
      "new_path": "packages/devtools_app/lib/src/screens/network/network_screen.dart"
    },
    {
      "type": "modify",
      "old_id": "9efd5482a7309b696f398c2e3daf7e800f8cd91f",
      "old_mode": 33188,
      "old_path": "packages/devtools_app/lib/src/screens/network/utils/http_utils.dart",
      "new_id": "b4c30797df08fe780a978106f55edc343fd1b457",
      "new_mode": 33188,
      "new_path": "packages/devtools_app/lib/src/screens/network/utils/http_utils.dart"
    },
    {
      "type": "modify",
      "old_id": "270bf0696a46df5e694a6f4bb11df7c7678330ca",
      "old_mode": 33188,
      "old_path": "packages/devtools_app/lib/src/shared/http/http_request_data.dart",
      "new_id": "81ec0d3552806857e90b321c20b6000572217668",
      "new_mode": 33188,
      "new_path": "packages/devtools_app/lib/src/shared/http/http_request_data.dart"
    },
    {
      "type": "modify",
      "old_id": "3a1360652196814fd4c370102a18be379eb0a805",
      "old_mode": 33188,
      "old_path": "packages/devtools_app/release_notes/NEXT_RELEASE_NOTES.md",
      "new_id": "323d3c199389b225b17a2c60df0f34692526ce34",
      "new_mode": 33188,
      "new_path": "packages/devtools_app/release_notes/NEXT_RELEASE_NOTES.md"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "ba09d7f1c5b3973d27bdc430d449d21895f99a3a",
      "new_mode": 33188,
      "new_path": "packages/devtools_app/test/shared/http/http_request_data_test.dart"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "94853734b4d906665caa5cf9b7daaa2eb9257428",
      "new_mode": 33188,
      "new_path": "packages/devtools_app/test/shared/http/http_utils_test.dart"
    }
  ]
}
