1.18.0 performance items: reference 404 placeholder and heading font without preload, lazy form and Turnstile code (eager entry /client/eager), Turnstile space kept, background video paused for reduced motion, card hover on opacity, metadata stripped on upload, MongoDB TTL indexes for the consent log and statistics, unused-media notice, version limit for the plugin's entities
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
076b3ef707
commit
d628839235
@@ -1,5 +1,6 @@
|
||||
import type { CollectionConfig, Endpoint, PayloadRequest } from 'payload'
|
||||
|
||||
import { TTL_FIELD } from '../shared/ttl.js'
|
||||
import type { CollectionOverride } from '../shared/collectionOverride.js'
|
||||
|
||||
import { userMeetsRole } from '../access/predicates.js'
|
||||
@@ -44,6 +45,12 @@ export type ConsentLogOptions = {
|
||||
collectionOverrides?: CollectionOverride
|
||||
/** Days a record is kept. Default 1095 (3 years). */
|
||||
retentionDays?: number
|
||||
/**
|
||||
* MongoDB: a TTL index deletes records older than `retentionDays` by itself, also when no new record comes
|
||||
* (1.18.0; shared/ttl.ts). Default true; `false` drops the index at the next start — the purge after a new record
|
||||
* stays. Postgres / SQLite: not used.
|
||||
*/
|
||||
ttlIndex?: boolean
|
||||
}
|
||||
|
||||
export function buildConsentLogCollection(): CollectionConfig {
|
||||
@@ -154,6 +161,7 @@ export function buildConsentLogEndpoint({ retentionDays = 1095 }: ConsentLogOpti
|
||||
data: {
|
||||
choices: Object.fromEntries(CONSENT_CATEGORIES.map((c) => [c, b.state![c] === true])),
|
||||
consentId: b.id,
|
||||
[TTL_FIELD]: new Date().toISOString(), // MongoDB TTL counts from here (dropped where the field is not there)
|
||||
version: b.version,
|
||||
} as never,
|
||||
overrideAccess: true,
|
||||
|
||||
Reference in New Issue
Block a user