[windows] File.readTextSync / File.writeTextSync are stubs — reads yield "undefined", writes silently no-op

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

Maintainer thường phản hồi trong vòng 1 ngày

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
48/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
Lĩnh vực
backend

Hướng nghiên cứu

Start by tracing File.readTextSync() and File.writeTextSync() in @nativescript/core, then compare their Windows implementations with the working async methods. Reproduce the reported behavior in a packaged Windows app and identify the relevant tests or entry points. Done means synchronous reads return file contents and repeated writes update the file on Windows.

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

Mô tả

On NativeScript Windows (packaged WinUI/MSIX x64 app), the synchronous file APIs in @nativescript/core are non-functional while their async counterparts work:

  • File.fromPath(p).readTextSync() returns the string "undefined" rather than file contents (feeding it to JSON.parse throws "undefined" is not valid JSON).
  • File.fromPath(p).writeTextSync(text) returns without throwing but does not modify the file. Subsequent calls in the same process also report success without writing — the file keeps its initial contents regardless of write count.

File.readText() / File.writeText() (async) perform real IO on the same paths.

Evidence: a packaged app calling writeTextSync 18 times per boot (instrumented counter, no thrown errors) produced a file containing only the first write's data; readTextSync of that file threw a JSON parse error on "undefined". This caused a preferences-persistence feature to silently lose every write — a real consumer-facing data-loss path for any app relying on the sync APIs (e.g. settings stores, caches).

Environment: Windows 11 x64 (10.0.26200.9711), packaged MSIX, NativeScript Windows runtime current as of Nov 2026.

Ngôn ngữ chính
TypeScript
Star
25.7k
Fork
1.7k
Merge trung bình
4 ngày 2 giờ
Pull request đã merge (30 ngày)
41

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 NativeScript/NativeScript

Tất cả issue của NativeScript/NativeScript

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.