Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Schema cache stores ~950KB in globalState, triggering VS Code's large-extension-state warning

Đang mở
#151 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
68/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
typescript, vscode
Lĩnh vực
devtools

Hướng nghiên cứu

Bắt đầu với ARCHITECTURE.md và theo dõi cầu nối kusto/getData và kusto/setData qua SchemaManager và globalState của VS Code. Xác định cách payload của schema được lưu bền vững qua các phiên, sau đó sử dụng globalStorageUri đồng thời giữ nguyên hành vi bộ nhớ đệm trong bộ nhớ và giữa các phiên. Được xem là hoàn tất khi dữ liệu globalState hiện có đã được di chuyển hoặc loại bỏ và cảnh báo về trạng thái mở rộng lớn không còn xuất hiện lại.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

enhancement

Problem

VS Code logs this warning repeatedly during normal use:

[warning] [mainThreadStorage] large extension state detected
(extensionId: ms-kusto.kusto-explorer-vscode, global: true): 949.6767578125kb.
Consider to use 'storageUri' or 'globalStorageUri' to store this data on disk instead.

Roughly 950 KB is being held in globalState, and the warning repeats as the value is rewritten.

Where it comes from

The schema cache. Per ARCHITECTURE.md, schema is cached at two levels: in-memory in SchemaManager, plus VS Code storage across sessions via the kusto/getData / kusto/setData → globalState bridge, so startup is usable immediately while background reconciliation refreshes both copies.

The cross-session half of that design is what trips the warning. globalState is a key/value store intended for small values — VS Code keeps it in memory and serializes it — so a cached database schema is well outside what it is meant to hold. globalStorageUri is the documented place for payloads of this size.

Impact

Nothing is broken today, and the caching design itself is sound — this is about the storage medium, not the strategy. But it grows with the number of connected clusters and the size of their schemas, so a user with several large clusters will push it further. The observed ~950 KB came from ordinary use.

Reproduction

  1. Launch the Extension Development Host and connect to any cluster so schema is fetched.
  2. Watch the extension host log.
  3. The mainThreadStorage warning appears and recurs as schema is written back.

Notes

  • Pre-existing and unrelated to any PR currently open. Observed on branches for #146 and #148 alike, and it comes from schema caching that predates both.
  • Surfaced while testing those PRs in a live Extension Development Host, so filing it rather than losing the observation.
  • A fix would move the persisted schema payload to globalStorageUri while keeping the two-level cache behavior intact — including migrating or discarding whatever is already in globalState so the warning actually stops.
Ngôn ngữ chính
TypeScript
Star
6
Fork
7
Merge trung bình
1 ngày 6 giờ
Pull request đã merge (30 ngày)
4

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của microsoft/Kusto-Explorer-VsCode

Tất cả issue của microsoft/Kusto-Explorer-VsCode

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.