Skip to content

Conversation

@tathagat2241
Copy link
Contributor

Changes

  • Version Limit Enforcement: Added #enforceVersionLimit() method to ConfigurationCollection that automatically cleans up old versions on every save() operation
  • Asynchronous Execution: Cleanup runs via setImmediate() to avoid blocking the main save operation
  • Batch Deletion: Deletes old versions in batches of 25 (DynamoDB batch write limit) for optimal performance
  • Graceful Error Handling: Cleanup failures are logged but don't affect the main save operation
  • Comprehensive Testing: Added 8 new test cases covering all cleanup scenarios, edge cases, and error handling

Technical Details

  • Trigger: Cleanup runs automatically after each configuration create() (save)
  • Target: Keeps newest 500 versions, deletes older versions beyond this limit
  • Safety: Only affects Configuration entities (ElectroDB entity isolation via GSI)
  • Performance: Uses DynamoDB batch operations and parallel deletion with Promise.all()

Please ensure your pull request adheres to the following guidelines:

  • make sure to link the related issues in this description
  • when merging / squashing, make sure the fixed issue references are visible in the commits, for easy compilation of release notes

Related Issues

https://jira.corp.adobe.com/browse/SITES-37650

Thanks for contributing!

@tathagat2241 tathagat2241 requested a review from ravverma December 2, 2025 09:24
@github-actions
Copy link

github-actions bot commented Dec 2, 2025

This PR will trigger a minor release when merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants