Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Disable async activation for channel types not showing config page #5662

Merged
merged 1 commit into from
Nov 19, 2024

Conversation

norkans7
Copy link

The channel types do not have a config UI page so when activate fails, the channel is useless, this change will release the channel so the use can claim that again

if channel_type.async_activation:
on_transaction_commit(lambda: channel_type.activate(channel))
else:
try:
channel_type.activate(channel)
except Exception as e:
# release our channel, raise error upwards
channel.release(user)
raise e

Copy link

codecov bot commented Nov 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (a89ae1c) to head (bb549bb).

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #5662   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          565       565           
  Lines        25835     25839    +4     
=========================================
+ Hits         25835     25839    +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

@rowanseymour
Copy link
Member

@norkans7 remind me again, the point of async_activation is that a channel can call back to us and the channel will definitely exist in the db? Or that we need a channel to have uuid/id when we activate it? Are we sure these types don't require that?

@norkans7
Copy link
Author

@rowanseymour We need the UUID as most of the time that is used for the URL we send in when setting the webhook URL
so the channel need to be in the DB
And we just made those activation request in the background task
The issue is when that activation fail, the channel in the DB is useless

Some channel types such as D3C still have the config page and the user can go and manually set the webhook URL, for these we they cannot manually set the URL so we do not show the config page, so I think in case the activation fail we clean up the DB object by releasing that.

@rowanseymour rowanseymour merged commit 7e20ace into main Nov 19, 2024
5 checks passed
@rowanseymour rowanseymour deleted the WAC-activate branch November 19, 2024 16:28
@github-actions github-actions bot locked and limited conversation to collaborators Nov 19, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants