Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix: circular dependencies disable all involved extensions #3785

Merged
merged 2 commits into from
Apr 12, 2023

Conversation

SychO9
Copy link
Member

@SychO9 SychO9 commented Apr 10, 2023

Changes proposed in this pull request:
Throws an exception wen circular dependencies are found, which prevents the extensions within the circular depdencies fro getting all disabled.

Screenshot
This is an example where I created a circular dependency with emoji, suspend, and likes:
image

Necessity

  • Has the problem that is being solved here been clearly explained?
  • If applicable, have various options for solving this problem been considered?
  • For core PRs, does this need to be in core, or could it be in an extension?
  • Are we willing to maintain this for years / potentially forever?

Confirmed

  • Frontend changes: tested on a local Flarum installation.
  • Backend changes: tests are green (run composer test).
  • Core developer confirmed locally this works as intended.
  • Tests have been added, or are not appropriate here.

Required changes:

  • Related documentation PR: (Remove if irrelevant)
  • Related core extension PRs: (Remove if irrelevant)

SychO9 and others added 2 commits April 10, 2023 15:31
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
@SychO9 SychO9 requested a review from a team as a code owner April 10, 2023 14:36
@SychO9 SychO9 added this to the 1.8 milestone Apr 10, 2023
@SychO9 SychO9 changed the title fix: throw exception on circular dependencies fix: circular dependencies disable all involved extensions Apr 10, 2023
Copy link
Member

@askvortsov1 askvortsov1 left a comment

Choose a reason for hiding this comment

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

Should we also reject attempts to enable extensions that would cause circular dependencies?

@SychO9
Copy link
Member Author

SychO9 commented Apr 10, 2023

That would already be rejected as well, whether the extension being enabled causes the circular dependency. Or whether there is an existing circular dependency with other already enabled extensions (due to an update). The error is thrown.

Copy link
Member

@askvortsov1 askvortsov1 left a comment

Choose a reason for hiding this comment

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

Ah right, this would run when enabled extensions are persisted. Looks good!

@SychO9 SychO9 merged commit e8c867d into main Apr 12, 2023
@SychO9 SychO9 deleted the sm/circular-dependencies-exception branch April 12, 2023 20:59
@github-actions github-actions bot mentioned this pull request May 17, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants