TL;DR
PayloadCMS v2.9.0 introduces a new forceAcceptWarning migration argument to bypass confirmation prompts, making automated migrations smoother. This release also fixes several critical bugs in database operations, particularly for PostgreSQL users, improves upload field functionality, and enhances performance for cloud storage operations. The update focuses on stability improvements while adding quality-of-life features for developers working with migrations.
Highlight of the Release
- New
forceAcceptWarning migration argument to bypass confirmation prompts
- Fixed PostgreSQL database migration issues
- Improved upload field functionality with proper draft version display
- Enhanced performance for cloud storage operations on large collections
- Fixed login hook write conflicts for better authentication reliability
- Improved UI by removing empty 'No Options' dropdown from hasMany fields
Migration Guide
Migration to v2.9.0
This release doesn't require any specific migration steps for most users. The changes are largely non-breaking and focus on bug fixes and enhancements.
For PostgreSQL Users
If you're using the PostgreSQL adapter, this update includes important fixes for migration operations and relation queries. After updating:
- Test your migration scripts, particularly any that include "down" operations
- Verify that your relation queries work as expected, especially for unset relations
For Cloud Storage Plugin Users
If you're using the cloud storage plugin with large collections, you should notice improved performance without any configuration changes needed.
Using the New forceAcceptWarning Feature
To use the new migration argument in automated environments:
await payload.migrate({
forceAcceptWarning: true
});
This will bypass any confirmation prompts during the migration process.
Upgrade Recommendations
Recommendation Level: Recommended for all users
This release contains important bug fixes and performance improvements that benefit all PayloadCMS users. The upgrade is particularly valuable for:
- PostgreSQL database users due to critical fixes for migration and relation queries
- Users with large media collections using the cloud storage plugin
- Teams using automated deployment pipelines who will benefit from the new
forceAcceptWarning migration argument
The update is non-breaking and should be straightforward to apply. As always, test thoroughly in a staging environment before deploying to production.
Bug Fixes
Database Fixes
- PostgreSQL Specific Fixes:
- Fixed migration down errors that were preventing proper rollback operations
- Resolved issues with querying unset relations that could cause unexpected behavior
Migration Fixes
- Fixed missing filter for latest batch in migrate down operations, ensuring proper migration state management
UI and Field Fixes
- Fixed upload input drawer not showing draft versions, improving content editing workflow
- Removed empty "No Options" dropdown from hasMany fields when no options are available, enhancing UI clarity
Authentication Fixes
- Resolved afterLogin hook write conflicts that could cause race conditions and data inconsistencies
- Improved login attempt tracking with proper transaction handling
Plugin Fixes
- Cloud Storage Plugin: Fixed slow file retrieval performance on large collections, significantly improving load times for media-heavy applications
New Features
New Migration Argument: forceAcceptWarning
The most significant new feature in v2.9.0 is the addition of a forceAcceptWarning argument for migrations. This feature allows developers to:
- Automatically accept warning prompts during migration operations
- Streamline CI/CD pipelines by eliminating the need for manual intervention
- Make automated deployments more reliable by bypassing confirmation steps
This is particularly useful in automated environments where user interaction isn't possible. The implementation includes fallback mechanisms for migration directories and improved test suite integration.
Other Improvements
- Made default views callable, enhancing flexibility in view customization
- Re-ordered request language detection for better internationalization support
- Added a
fieldIsGroupType type guard helper for improved type safety
Security Updates
No specific security fixes were mentioned in this release. The release focuses primarily on feature enhancements, bug fixes, and performance improvements.
Performance Improvements
Cloud Storage Performance
The most notable performance improvement in v2.9.0 addresses slow file retrieval in the cloud storage plugin when working with large collections. This enhancement significantly reduces load times and improves overall responsiveness when accessing media files stored in cloud services.
Development Workflow Improvements
- Added transaction support in tests running MongoDB memory server, making tests more reliable and faster
- Improved relationship test async setup, reducing test flakiness
- Enhanced localization test stability
Impact Summary
PayloadCMS v2.9.0 delivers a focused set of improvements that enhance developer experience and system reliability. The new forceAcceptWarning migration argument addresses a common pain point in automated deployments by allowing migrations to proceed without manual confirmation. This is particularly valuable for CI/CD pipelines and serverless environments.
Database operations see significant improvements, especially for PostgreSQL users, with fixes for migration operations and relation queries. These changes ensure more reliable data management and prevent potential issues during schema updates.
Content editors benefit from UI enhancements and fixes, particularly in upload fields and relationship fields. The fix for afterLogin hook write conflicts improves authentication reliability, preventing potential data inconsistencies.
Performance improvements in the cloud storage plugin address a critical bottleneck for sites with large media collections, ensuring faster page loads and better user experience.
Overall, this release demonstrates PayloadCMS's commitment to stability and developer experience, with thoughtful improvements that address real-world usage scenarios.
Full Release Notes
2.9.0 (2024-01-26)
Features
- forceAcceptWarning migration arg added to accept prompts (#4874) (eba53ba)
Bug Fixes
- afterLogin hook write conflicts (#4904) (3eb681e)
- db-postgres: migrate down error (#4861) (dfba522)
- db-postgres: query unset relation (#4862) (8ce15c8)
- migrate down missing filter for latest batch (#4860) (b99d24f)
- plugin-cloud-storage: slow get file performance large collections (#4927) (f73d503)
- remove No Options dropdown from hasMany fields (#4899) (e5a7907)
- upload input drawer does not show draft versions (#4903) (6930c4e)