Repository navigation
Closed
Description
Describe the Bug
The updatedAt field is not being updated when saving new drafts, only when publishing documents.
Screen.Recording.2025-01-08.at.06.53.04.mp4
Link to the code that reproduces this issue
Test results
ALL RESULTS
[PASS] _Community Tests > updatedAt in published documents > should change when a document is updated (1046ms)
[FAIL] _Community Tests > updatedAt in drafts > should change when a new draft is created (1037ms)
[FAIL] _Community Tests > updatedAt in drafts > should change when a new draft is created (foundDraft.updatedAt) (1043ms)
[FAIL] _Community Tests > updatedAt in drafts > should change when a new draft is created (version.version.updatedAt) (1041ms)
● _Community Tests › updatedAt in drafts › should change when a new draft is created
expect(received).toBeGreaterThan(expected)
Expected: > 1736314503000
Received: 1736314503000
97 |
98 | expect(updatedDraft.title).toEqual('changed')
> 99 | expect(+new Date(updatedDraft.updatedAt)).toBeGreaterThan(+new Date(post.updatedAt))
| ^
100 | })
101 |
102 | // failing test
at Object.toBeGreaterThan (_community/int.spec.ts:99:49)
● _Community Tests › updatedAt in drafts › should change when a new draft is created (foundDraft.updatedAt)
expect(received).toBeGreaterThan(expected)
Expected: > 1736314504000
Received: 1736314504000
127 |
128 | expect(foundDraft.title).toEqual('changed')
> 129 | expect(+new Date(foundDraft.updatedAt)).toBeGreaterThan(+new Date(post.updatedAt))
| ^
130 | })
131 |
132 | // failing test
at Object.toBeGreaterThan (_community/int.spec.ts:129:47)
● _Community Tests › updatedAt in drafts › should change when a new draft is created (version.version.updatedAt)
expect(received).toBeGreaterThan(expected)
Expected: > 1736314505000
Received: 1736314505000
162 |
163 | expect(foundVersion.version.title).toEqual('changed')
> 164 | expect(+new Date(foundVersion.version.updatedAt)).toBeGreaterThan(+new Date(post.updatedAt))
| ^
165 | })
166 | })
167 | })
at Object.toBeGreaterThan (_community/int.spec.ts:164:57)
Executed 4 of 4 (skipped 0) FAILED (16.201 secs)
TOTAL: 3 FAILED
Reproduction Steps
- Publish a document with drafts enabled
- Save a new draft
- Observe that the
updatedAtfield didn't change
Also check included tests.
Which area(s) are affected? (Select all that apply)
db-mongodb, area: ui, area: core
Environment Info
Payload: 3.15.1
Node: 22.8.0
Next: 15.1.3
Activity
[-]`updatedAt` is not udpated when saving drafts[/-][+]`updatedAt` is not updated when saving drafts[/+]DanRibbens commentedon Jan 10, 2025
@paulpopus #9230
fix(ui): fixed issue with updatedAt timestamps not updating in the UI…
github-actions commentedon Jan 13, 2025
🚀 This is included in version v3.17.0
github-actions commentedon Jan 15, 2025
This issue has been automatically locked.
Please open a new issue if this issue persists with any additional detail.
fix(ui): fixed issue with updatedAt timestamps not updating in the UI…