Payload CMS Release: 2.22.1
Tag Name: v2.22.1
Release Date: 6/25/2024
Payload CMSPayload CMS is a modern, self-hosted headless content management system built with TypeScript, Node.js, and MongoDB. It's designed specifically for developers who want full control over their content management system while maintaining a powerful admin interface for content editors.
TL;DR
Payload CMS 2.22.1: Critical Bug Fixes for GraphQL and Image Cropping
This patch release addresses two important bugs in Payload CMS:
- Fixed GraphQL query concurrency issues that were causing race conditions and inconsistent results
- Resolved an image cropping bug where percent values were being sent instead of pixel values
These fixes improve stability for GraphQL API users and ensure proper image processing functionality.
Highlight of the Release
- Fixed GraphQL query concurrency issues that were causing race conditions
- Resolved image cropping bug where percent values were incorrectly sent instead of pixel values
- Improved transaction handling for better data consistency
Migration Guide
No migration steps are required for this patch release. The fixes are backward compatible and will take effect automatically after upgrading to version 2.22.1.
Upgrade Recommendations
This patch release is highly recommended for all Payload CMS users, especially for:
- Applications that make heavy use of the GraphQL API
- Systems where multiple concurrent GraphQL queries are common
- Projects that utilize image cropping functionality
The upgrade process should be straightforward with no breaking changes:
npm install [email protected]
# or
yarn add [email protected]
# or
pnpm add [email protected]
After upgrading, no additional configuration changes are required.
Bug Fixes
GraphQL Query Concurrency Issues Fixed
This release resolves issues #6800 and #5108 related to GraphQL query concurrency. The problems were caused by race conditions in transaction handling that could lead to inconsistent results when making multiple GraphQL queries simultaneously.
The fix improves the isolateObjectProperty utility function and simplifies the transaction ID handling by flattening req.transactionID and req.transactionIDPromise to a single req.transactionID property. This change ensures more reliable and consistent behavior when executing concurrent GraphQL operations.
Image Cropping Pixel Values
Fixed issue #6824 where the image cropping functionality was incorrectly sending percentage values to the server instead of pixel values. This was causing problems with image processing and resulting in unexpected cropping results.
The fix ensures that proper pixel values are sent to the server when cropping images, leading to more accurate and predictable image processing outcomes.
New Features
No new features were added in this patch release. This is a bug fix release focused on addressing specific issues.
Security Updates
No specific security fixes were included in this release.
Performance Improvements
This release includes performance improvements related to GraphQL query handling. By fixing the concurrency issues and improving transaction management, GraphQL operations should now be more efficient and reliable, especially in high-concurrency scenarios where multiple queries are being executed simultaneously.
The improved transaction handling reduces the likelihood of race conditions, which not only improves stability but can also prevent unnecessary query retries or failures that would impact performance.
Impact Summary
Payload CMS 2.22.1 is a targeted patch release that addresses two specific bugs that were affecting GraphQL API reliability and image cropping functionality.
The GraphQL concurrency fix resolves race conditions that could lead to inconsistent query results, particularly in high-traffic applications where multiple GraphQL operations might be happening simultaneously. This improvement makes the GraphQL API more robust and predictable.
The image cropping fix ensures that pixel values rather than percentage values are sent to the server during image processing operations, resulting in more accurate and expected cropping behavior.
While these changes are technically small in scope, they address important usability and reliability issues that could significantly impact applications relying on these features. The release contains no breaking changes and should be a safe upgrade for all users.
