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

Correctly await sendSMS #413

Merged
merged 3 commits into from Oct 8, 2021
Merged

Conversation

babolivier
Copy link
Contributor

@babolivier babolivier commented Oct 8, 2021

Fixing this warning, which might be the cause of #411

Oct  8 14:16:14 corus sydent-vectoris[21655]: /opt/vectoris/sydent/sydent/validators/msisdnvalidator.py:131: RuntimeWarning: coroutine 'OpenMarketSMS.sendTextSMS' was never awaited
Oct  8 14:16:14 corus sydent-vectoris[21655]:   self.omSms.sendTextSMS(smsBody, msisdn, originator)
Oct  8 14:16:14 corus sydent-vectoris[21655]: RuntimeWarning: Enable tracemalloc to get the object allocation traceback

@babolivier babolivier requested a review from a team October 8, 2021 15:26
@DMRobertson DMRobertson self-assigned this Oct 8, 2021
Copy link
Contributor

@DMRobertson DMRobertson left a comment

Choose a reason for hiding this comment

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

Seems reasonable. I wonder if mypy or similar could have spotted this; doesn't look like it's setup for sydent.

changelog.d/413.bugfix Outdated Show resolved Hide resolved
@babolivier
Copy link
Contributor Author

babolivier commented Oct 8, 2021

Likely broke when converting to async/await in v2.4.0. We believe running the function in a fire-and-forget worked with inline callbacks and would run the function in the background, but would just not run it when using the async/await syntax.

@DMRobertson
Copy link
Contributor

Related: #310 ?

@DMRobertson
Copy link
Contributor

Seems reasonable. I wonder if mypy or similar could have spotted this; doesn't look like it's setup for sydent.

Looks like mypy wouldn't have caught this at present, at least not without a plugin. See python/mypy#2499.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants