Skip to content

Conversation

@ricardogarim
Copy link
Contributor

@ricardogarim ricardogarim commented Mar 1, 2025

Proposed changes (including videos or screenshots)

Previously, when a workspace downgraded from a trial or paid license to the community edition, all installed apps (both marketplace and private apps) remained enabled, regardless of the workspace’s new limitations. This led to workspaces retaining premium features beyond what was intended.

Marketplace Apps:

  • If the workspace has more than 5 marketplace apps, only the oldest 5 will remain enabled.
  • If the workspace has any premium marketplace apps, they will be disabled.

Private Apps:

  • Private apps that do not match the grandfathering condition will be disabled.
  • The grandfathering condition checks:
    • If the workspace was previously running a <7 version.
    • If the app was installed before upgrading to version 7.

Issue(s)

Steps to test or reproduce

Marketplace Apps

  • Create a workspace and activate a trial license.
  • Install multiple apps from the Marketplace, including both normal and premium apps.
  • Navigate to Settings > Subscription and cancel the trial or subscription.
  • Go to the Apps listing and verify:
    • Any marketplace app exceeding the 5-app limit is disabled (only the oldest 5 remain enabled).
    • All premium marketplace apps are disabled.

Private Apps

  • Create a workspace and activate a trial license.
  • Install a private app.
  • Navigate to Settings > Subscription and cancel the trial or subscription.
  • Go to the Apps listing and confirm the private app has been disabled.

Grandfathered Private Apps

  • Create a workspace and activate a trial license.
  • Install a private app and ensure it is successfully installed.
  • In the database:
    • Duplicate a document from the rocketchat_statistics collection.
    • Change the version field to a pre-7 version (e.g., 6.9.0).
    • Update the installedDate to a date before the upgrade to version 7.
  • In the installed apps database (rocketchat_apps collection):
    • Modify the createdDate field to a date that aligns with the pre-7 installation date.
  • Navigate to Settings > Subscription and cancel the trial or subscription.
  • Go to the Apps listing and verify that the private app remains enabled (grandfathered condition is met).

Further comments

It's a bit tricky to enforce the grandfathering condition reliably. After discussing with the team, we identified a potential approach: checking app statistics. If any recorded statistics indicate usage from a pre-7 version, we can infer that the workspace previously ran that version, allowing us to determine eligibility for grandfathering.

@dionisio-bot
Copy link
Contributor

dionisio-bot bot commented Mar 1, 2025

Looks like this PR is ready to merge! 🎉
If you have any trouble, please check the PR guidelines

@changeset-bot
Copy link

changeset-bot bot commented Mar 1, 2025

🦋 Changeset detected

Latest commit: 8bc95d4

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 35 packages
Name Type
@rocket.chat/model-typings Patch
@rocket.chat/models Patch
@rocket.chat/meteor Patch
@rocket.chat/apps Patch
@rocket.chat/account-service Patch
@rocket.chat/authorization-service Patch
@rocket.chat/ddp-streamer Patch
@rocket.chat/omnichannel-transcript Patch
@rocket.chat/presence-service Patch
@rocket.chat/queue-worker Patch
@rocket.chat/stream-hub-service Patch
@rocket.chat/omnichannel-services Patch
rocketchat-services Patch
@rocket.chat/core-services Patch
@rocket.chat/cron Patch
@rocket.chat/instance-status Patch
@rocket.chat/presence Patch
@rocket.chat/network-broker Patch
@rocket.chat/core-typings Patch
@rocket.chat/rest-typings Patch
@rocket.chat/uikit-playground Patch
@rocket.chat/api-client Patch
@rocket.chat/ddp-client Patch
@rocket.chat/freeswitch Patch
@rocket.chat/fuselage-ui-kit Patch
@rocket.chat/gazzodown Patch
@rocket.chat/livechat Patch
@rocket.chat/ui-contexts Patch
@rocket.chat/license Patch
@rocket.chat/pdf-worker Patch
@rocket.chat/ui-avatar Patch
@rocket.chat/ui-client Patch
@rocket.chat/ui-video-conf Patch
@rocket.chat/ui-voip Patch
@rocket.chat/web-ui-registration Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@codecov
Copy link

codecov bot commented Mar 1, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 59.67%. Comparing base (c904862) to head (8bc95d4).
Report is 1 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff            @@
##           develop   #35374   +/-   ##
========================================
  Coverage    59.67%   59.67%           
========================================
  Files         2826     2826           
  Lines        68313    68313           
  Branches     15134    15134           
========================================
  Hits         40764    40764           
  Misses       24937    24937           
  Partials      2612     2612           
Flag Coverage Δ
unit 75.86% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ricardogarim ricardogarim force-pushed the refactor/legacy-app-support branch from 5f986ed to d84a316 Compare March 6, 2025 10:40
@ricardogarim ricardogarim marked this pull request as ready for review March 6, 2025 10:56
@ricardogarim ricardogarim requested a review from a team as a code owner March 6, 2025 10:56
@ricardogarim ricardogarim added this to the 7.5.0 milestone Mar 6, 2025
Copy link
Contributor

@MarcosSpessatto MarcosSpessatto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks more a fix rather than a refactor.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 10, 2025

PR Preview Action v1.6.0

🚀 View preview at
https://RocketChat.github.io/Rocket.Chat/pr-preview/pr-35374/

Built to branch gh-pages at 2025-03-20 03:01 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@MarcosSpessatto MarcosSpessatto added the stat: QA assured Means it has been tested and approved by a company insider label Mar 19, 2025
@dionisio-bot dionisio-bot bot added the stat: ready to merge PR tested and approved waiting for merge label Mar 19, 2025
@kodiakhq
Copy link
Contributor

kodiakhq bot commented Mar 19, 2025

This PR currently has a merge conflict. Please resolve this and then re-add the ['stat: ready to merge', 'automerge'] label.

@kodiakhq kodiakhq bot removed the stat: ready to merge PR tested and approved waiting for merge label Mar 19, 2025
@ricardogarim ricardogarim added stat: QA assured Means it has been tested and approved by a company insider and removed stat: QA assured Means it has been tested and approved by a company insider labels Mar 19, 2025
@dionisio-bot dionisio-bot bot added the stat: ready to merge PR tested and approved waiting for merge label Mar 19, 2025
@kodiakhq kodiakhq bot merged commit 3b54061 into develop Mar 20, 2025
48 checks passed
@kodiakhq kodiakhq bot deleted the refactor/legacy-app-support branch March 20, 2025 03:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stat: QA assured Means it has been tested and approved by a company insider stat: ready to merge PR tested and approved waiting for merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants