Open KyrneDev opened 6 years ago
I'm not too sure about the way we should handle this.
First, I don't believe we have planned to make any automated expiration available ? Unless there is an issue with a credit card the subscription needs to be explicitly ended. The current behavior of Bazaar (in #66) is to not offer the unsubscribe action for any installed extensions. You need to uninstall (not only disable) it beforehand.
Of course you can also unsubscribe via flagrow.io, which is where Bazaar should take action.
Technically, here's what happens: once unsubscribed, the Satis endpoint does not list the extension anymore. Access to tarballs on flagrow.io is also blocked. This means any require
, install
or update
Composer commands will fail in Flarum unless an action is taken.
Here's my idea:
Bazaar should check if any unsubscribed extension is still installed and prompt the user to uninstall it before trying anything else with Bazaar.
Additionally a webhook could warn Bazaar of unsubscribe events coming from flagrow.io so Bazaar can block these extensions. I suggest we just disable them and prevent any attempt at re-enabling until the action described above is taken. Only disabling would remove the complicated matter of uninstalling an extension without running the migrations down (if we uninstall the source, we will never be able to run migrations down!).
@clarkwinkelmann I think we should consider the option for extension developers (which includes us) to specify they want to remove an extension once their subscription has expired. Hence I think this should not be the default behavior!
I think we can do this best using a webhook call.
Please understand that Bazaar will never ever get commands from us through the api (eg flagrow.io telling a bazaar to do uninstall an extension). We will only trigger it to start doing something (like flagrow.io saying bazaar to "there's something you need to take a look at" and Bazaar calling on Flagrow.io to read what it is it needs doing and then processing it).
The system should try to remove the extension from the users forum.
Things that should happen: