Skip to content

Conversation

@Julusian
Copy link
Member

@Julusian Julusian commented Oct 6, 2025

About the Contributor

This pull request is posted on behalf of Superfly

Type of Contribution

This is a: Feature / Code improvement / Documentation improvement

Current Behavior

Sofie currently supports any number of studios

New Behavior

As discussed in #1450, this starts to remove support for having more than 1 studio.
At this stage it simply attempts to stop it from being possible to create more than 1, or to delete the last studio, and adds a migration to complain if there is more than 1.

This is the first stage of this, once this is merged future changes could start to assume that there is only one studio in the system.

Testing

  • I have added one or more unit tests for this PR
  • I have updated the relevant unit tests
  • No unit test changes are needed for this PR

Affected areas

Time Frame

Not urgent, but we would like to get this merged into the in-development release.

Other Information

Status

  • PR is ready to be reviewed.
  • The functionality has been tested by the author.
  • Relevant unit tests has been added / updated.
  • Relevant documentation (code comments, system documentation) has been added / updated.

This is not strict about it, if a system has more than one then it will simply get a stuck migration. Once the system has a single studio it will not allow adding or removing any.
@Julusian Julusian requested a review from a team as a code owner October 6, 2025 11:04
@Julusian Julusian added Contribution from SuperFly.tv Contributions sponsored by SuperFly.tv Contribution External contribution labels Oct 6, 2025
@codecov-commenter
Copy link

codecov-commenter commented Oct 6, 2025

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 34.78261% with 30 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
meteor/server/api/studio/api.ts 0.00% 16 Missing ⚠️
meteor/server/api/rest/v1/studios.ts 0.00% 13 Missing ⚠️
meteor/server/migration/X_X_X.ts 93.33% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!


{studios.map((studio) => (
<SettingsMenuStudio key={unprotectString(studio._id)} studio={studio} />
<SettingsMenuStudio key={unprotectString(studio._id)} studio={studio} canDelete={canDeleteStudio} />
Copy link
Contributor

Choose a reason for hiding this comment

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

It seems that after resolving migration steps, canDelete will always be false? If that's the case, does it still make sense to propagate this property rather than removing the button altogether?

Copy link
Member Author

Choose a reason for hiding this comment

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

The migration relies on the user to 'manually' fixup the system if there is more than 1 studio.
This button is the easiest way to do that, the other being to do it directly in mongodb.

So at this stage of being a soft-enforcmenet of 1 studio, I thought this was best to make it easy to resolve.
But yes as some point when we it is strongly enforced that there is 1 studio, then yes this should go away

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

Labels

Contribution from SuperFly.tv Contributions sponsored by SuperFly.tv Contribution External contribution

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants