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

未关闭
#10,516 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
30/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
laravel, php
领域
backend

调研方向

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.

由索引模型根据 Issue 内容生成。

描述

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

主要语言
PHP
星标
4.9k
派生
647
平均合并
1 天 45 分钟
30 天内合并 PR
221

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

statamic/cms 的其他 Issue

查看 statamic/cms 的全部 Issue

相似的 Issue

更多 PHP Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。