Skip to content

Conversation

@douglas-xt
Copy link
Contributor

What does this PR do?

Implements intelligent file version cleanup when users downgrade between subscription plans that both support file versioning. The system now adjusts the number of versions per file and removes expired versions according to the limits of the new tier.

Why are we doing this?

Previously, file version cleanup only occurred when users downgraded to plans without file versioning support, resulting in complete deletion of all versions. However, when users downgrade between plans that both have versioning enabled but with different limits (e.g., from Ultimate to Premium), versions were not being adjusted to match the new tier's restrictions.

How are we doing this?

The system now detects when file versioning remains enabled after a tier change and applies the new tier's version limits. It removes versions that exceed the maximum allowed per file and deletes versions older than the retention period of the new plan. When versioning is disabled, it continues to remove all versions as before.

Should this be manually tested & how?

Already tested manually using curl commands against the gateway endpoint. A test user with 100 files and 25 versions per file was created, then downgraded from Ultimate to Premium tier. The system correctly deleted excess versions according to Premium limits (keeping 10 versions per file). Subsequently tested downgrade to Free tier, which successfully removed all remaining versions.

Any background context you want to provide?

This change affects the gateway user update flow when tier changes occur. The feature maintains backward compatibility with the existing full cleanup behavior for free tier downgrades while adding the new partial cleanup logic for downgrades between paid tiers.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Feb 6, 2026

@jzunigax2 jzunigax2 merged commit d7fa675 into master Feb 6, 2026
13 checks passed
@jzunigax2 jzunigax2 deleted the feat/partial-undo-file-versioning branch February 6, 2026 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants