payloadcms / payloadcms/payload
Autosave is not compatible with Folders - New documents cannot be created in folders
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 44.8k
- Forks
- 4.2k
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 53
Description
Describe the Bug
When auto save is enabled on a collection that supports folders, it causes an issue when you attempt to create a new document from an existing folder. As soon as you start editing the document it will autosave and return you to the folder index.
Expected behaviour: When using Auto save and creating a document from a folder the user remains on the edit page whilst auto save happens in the background.
Actual Behaviour: When the user starts editing they are unexpectedly exited from the edit screen.
Link to the code that reproduces this issue
https://github.com/tkgdbowen/payload-autosave-folder-issue
This is a minimal repo on the blank create-payload-app, see single change for collection setup here:
https://github.com/tkgdbowen/payload-autosave-folder-issue/commit/e10afb84a434955f6ff4eeeeaf3a5995308f517f
Reproduction Steps
- Create a new payload app using the website template
pnpx create-payload-app@latest - In payload.config.ts enable the folders feature
buildConfig({ folders: {}, ... }) - Enable to folders feature on the pages collection in
src\collections\Pages\index.ts, the versions feature is already enabled by default.export const Pages: CollectionConfig<'pages'> = { folders: true, versions: { drafts: { autosave: { interval: 100 } } } ... } - Run the app
pnpm run dev - Click Browse by Folder
- Create a new folder called "Test"
- Browse in to the new folder
- Create new Page
- Begin typing the page Title
- Observe that the page auto saves as soon as the first character is typed and the user is returned to the folder index.
Which area(s) are affected?
area: core
Environment Info
Binaries:
Node: 24.14.0
npm: N/A
Yarn: N/A
pnpm: N/A
Relevant Packages:
payload: 3.80.0
next: 15.4.11
@payloadcms/db-postgres: 3.80.0
@payloadcms/drizzle: 3.80.0
@payloadcms/graphql: 3.80.0
@payloadcms/live-preview: 3.80.0
@payloadcms/live-preview-react: 3.80.0
@payloadcms/next/utilities: 3.80.0
@payloadcms/plugin-form-builder: 3.80.0
@payloadcms/plugin-nested-docs: 3.80.0
@payloadcms/plugin-redirects: 3.80.0
@payloadcms/plugin-search: 3.80.0
@payloadcms/plugin-seo: 3.80.0
@payloadcms/richtext-lexical: 3.80.0
@payloadcms/translations: 3.80.0
@payloadcms/ui/shared: 3.80.0
react: 19.2.1
react-dom: 19.2.1
Operating System:
Platform: win32
Arch: x64
Version: Windows 11 Pro
Available memory (MB): 65221
Available CPU cores: 20
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue with the linked minimal repository, starting with payload.config.ts and src/collections/Pages/index.ts, then run pnpm run dev and follow the folders and autosave behavior. Done means creating a page inside a folder, typing in it, and remaining on the edit page while autosave runs instead of returning to the folder index.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- next.js, react, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100