Commit df17cb1
authored
fix: globals not updating updatedAt when saving drafts (#15764)
### What
When saving drafts, version documents for globals weren't getting
updated `updatedAt` timestamps.
### Why
The condition in `saveVersion.ts` only checked `collection?.timestamps`,
which excluded globals even though they always have timestamps.
Broke stale data detection which relies on timestamp comparison to
detect concurrent edits.
### How
Added `|| global` check in `saveVersion.ts` since globals always have
timestamps but were excluded from the original `collection?.timestamps`
condition.1 parent ad4c0f6 commit df17cb1
File tree
2 files changed
+57
-7
lines changed- packages/payload/src/versions
- test/versions
2 files changed
+57
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
| 61 | + | |
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
15 | 14 | | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
1012 | 1012 | | |
1013 | 1013 | | |
1014 | 1014 | | |
1015 | | - | |
1016 | | - | |
1017 | | - | |
| 1015 | + | |
| 1016 | + | |
1018 | 1017 | | |
1019 | 1018 | | |
1020 | 1019 | | |
1021 | 1020 | | |
1022 | | - | |
1023 | | - | |
| 1021 | + | |
| 1022 | + | |
1024 | 1023 | | |
1025 | 1024 | | |
1026 | 1025 | | |
| |||
2324 | 2323 | | |
2325 | 2324 | | |
2326 | 2325 | | |
| 2326 | + | |
| 2327 | + | |
| 2328 | + | |
| 2329 | + | |
| 2330 | + | |
| 2331 | + | |
| 2332 | + | |
| 2333 | + | |
| 2334 | + | |
| 2335 | + | |
| 2336 | + | |
| 2337 | + | |
| 2338 | + | |
| 2339 | + | |
| 2340 | + | |
| 2341 | + | |
| 2342 | + | |
| 2343 | + | |
| 2344 | + | |
| 2345 | + | |
| 2346 | + | |
| 2347 | + | |
| 2348 | + | |
| 2349 | + | |
| 2350 | + | |
| 2351 | + | |
| 2352 | + | |
| 2353 | + | |
| 2354 | + | |
| 2355 | + | |
| 2356 | + | |
| 2357 | + | |
| 2358 | + | |
| 2359 | + | |
| 2360 | + | |
| 2361 | + | |
| 2362 | + | |
| 2363 | + | |
| 2364 | + | |
| 2365 | + | |
| 2366 | + | |
| 2367 | + | |
| 2368 | + | |
| 2369 | + | |
| 2370 | + | |
| 2371 | + | |
| 2372 | + | |
| 2373 | + | |
| 2374 | + | |
| 2375 | + | |
| 2376 | + | |
2327 | 2377 | | |
2328 | 2378 | | |
2329 | 2379 | | |
| |||
0 commit comments