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

Text overrides restored file due to trailing newline

Đang mở
#9,077 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ó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
55/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
javascript
Lĩnh vực
frontend

Hướng nghiên cứu

Bắt đầu từ đường dẫn SaveService và serializer được Viewer sử dụng, tái hiện sự cố với một tệp markdown có nội dung kết thúc bằng một ký tự xuống dòng ở cuối. Hoàn thành khi việc mở một tệp không thay đổi không còn tạo phiên bản mới và quá trình serialization vẫn giữ lại ký tự xuống dòng ở cuối.

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

Mô tả

bug

Describe the bug
Text auto saves unchanged file upon opening, no editing, due to a normalizer behavior. See videos:

To Reproduce
From the video, you need to restore a file and needs to have one specific thing, a trailing newline::

  1. restored version : 150 bytes, tail "...old line :)\n\n🌴\n"
  2. what Text wrote : 149 bytes, tail "...old line :)\n\n🌴"
  3. first difference at byte 149: restored "\n" vs written ""

Expected behavior
The serialiser should preserve a trailing newline, or SaveService should not write when the only difference is its own normalization. It's easy to demonstrate without Notes at all - put a markdown file ending in a newline in Files, open it in the Viewer, don't touch it, and a version appears within ~10 seconds.

Screenshots

https://github.com/user-attachments/assets/cdc53c60-243d-4400-994f-3647ead032f5

https://github.com/user-attachments/assets/9fbbed38-6bf2-4e17-afca-32a066ab50d1

Server details:

  • Nextcloud version: master
  • PHP Version: -
  • Database: -
  • I use the docker dev setup

Client details:

  • OS: Win11pro
  • Browser: FF
  • Browser version: 153.0.4
  • Device: Desktop
Logs
Nextcloud log (data/nextcloud.log)
Insert your Nextcloud log here
Browser log
Insert your browser log here, this could for example include:

a) The javascript console log
b) The network log
c) ...
Ngôn ngữ chính
JavaScript
Star
665
Fork
133
Merge trung bình
1 ngày 17 giờ
Pull request đã merge (30 ngày)
172

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 nextcloud/text

Tất cả issue của nextcloud/text

Issue tương tự

Thêm issue về JavaScript

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.