There's plenty of documentation about how to send an SMS via Twilio, but very little about how to receive one. Receiving one in a MongoDB Atlas Function involves an extra complication. By the end of this post you'll know how to receive a text in Twilio, and have it successfully interact with your MongoDB Atlas Function. I'll also cover a couple nice-to-have's in Twilio that you'll probably want to set up anyway.
Summary
While leaving “private comments” on a repo can be incredibly useful, it can get
you into trouble if the wrong person sees them and disagrees with what they see.
This post goes into the problems, consequences, and things that tools that
provide this functionality need to do to protect their users from accidental
harm.
Some Context
A while ago I wrote a tool called “Private Comments”, which allows you to leave
“private comments” on a codebase that aren’t actually in the codebase. Imagine
leaving little “breadcrumbs” for the future you that are actually attached to
the relevant lines of code, and go away when that code changes, but reappear if
you need to look at the relevant past version of it. It can be used for you, or
shared with your team.
A quick post to help future Raku geeks understand a couple of confusing error messages:
expected Positional[Array] but got Array
and
expected Associative[Hash] but got Hash
These are conceptually the same problem. If you’ve received one of these errors it means you’ve double-specified your parameter by using the @ or % and Array or Hash.
A parameter of Hash %foo says “I would like to be passed something that implements Associative and has a Hash in it.” (a Hash of Hashes). Likewise Array @foo says “I would like to be passed something that implements Positional and has an Array in it”. Yes, that sounds backwards. No, I can’t explain why.