Autosave puts work-in-progress edits live when working on already published entries

Đang mở
#10,516 0 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
30/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
laravel, php
Lĩnh vực
backend

Hướng nghiên cứu

Start by reading the autosave configuration at /config/statamic/autosave.php and the collection-level autosave setup described there. Reproduce the issue by editing a manually saved, published entry and waiting for autosave, then refresh its live page. The issue proposes several possible approaches but names no implementation files or tests; done means edits in progress no longer appear live before manual publication.

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

Mô tả

autosave
Bug description

If an editor is working on edits to an entry that is published, Autosave puts the partial updates live in 5 second chunks while the editor works.

Because of the way that the experimental Autosave functionality works, edits to entries that are already published will be autosaved over the top of the existing file that Statamic is also reading to serve the live page. That means that edits in progress will be published live before the editor realises.

I think there are three approaches to address this, which could be combined:

  1. Disable autosave on posts that are already published. This is the easiest, but should also warn the editor that autosave isn't running for that reason. This could also be an override-able option in autosave.php.

  2. Autosave could only function on published posts if Revisions are being used, and makes its changes to the working copy.

  3. Some other way of autosave keeping its work-in-progress away from the live file in a temporary file like Revisions does

I'm aware that Autosave is an experimental feature, and am up for testing and troubleshooting to refine it.

How to reproduce
  1. Enable autosave in /config/statamic/autosave,php
  2. Enable autosave on a collection as described in autosave.php
  3. Create an entry in that collection, and save it manually
  4. View that entry on the website in another browser tab
  5. Now go back and edit the entry, waiting enough time for autosave to happen. Don't press manual save!
  6. refresh the browser tab with the website display of the page and see your partial updates live
Logs

No response

Environment
Environment
Application Name: Convivio
Laravel Version: 11.17.0
PHP Version: 8.3.9
Composer Version: 2.7.7
Environment: local
Debug Mode: ENABLED
URL: convivio.test
Maintenance Mode: OFF
Timezone: Europe/London
Locale: en

Cache
Config: NOT CACHED
Events: NOT CACHED
Routes: NOT CACHED
Views: CACHED

Drivers
Broadcasting: log
Cache: file
Database: sqlite
Logs: stack / single
Mail: smtp
Queue: sync
Session: file

Livewire
Livewire: v3.5.4

Statamic
Addons: 11
Sites: 1
Stache Watcher: Enabled
Static Caching: Disabled
Version: 5.17.0 PRO

Statamic Addons
goldnead/statamic-toc: 1.5
jonassiewertsen/statamic-livewire: 3.6.0
mitydigital/feedamic: 2.4.1
statamic/wikilinks: 2.1.0
stillat/relationships: 2.2.1
studio1902/statamic-peak-browser-appearance: 3.5.0
studio1902/statamic-peak-commands: 8.4.0
studio1902/statamic-peak-seo: 8.15.3
studio1902/statamic-peak-tools: 6.3.0
tv2regionerne/statamic-passport: 1.4.1
tv2regionerne/statamic-private-api: 1.15.0
Installation

Existing Laravel app

Additional details

No response

Ngôn ngữ chính
PHP
Star
4.9k
Fork
647
Merge trung bình
1 ngày 45 phút
Pull request đã merge (30 ngày)
221

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

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

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 statamic/cms

Tất cả issue của statamic/cms

Issue tương tự

Thêm issue về PHP

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.