mozmeao / basket

Mozilla's email newsletter subscription management API service
https://basket.mozilla.org
Mozilla Public License 2.0
16 stars 17 forks source link

ctms.to_vendor() could not convert unknown data #1012

Open robhudson opened 1 year ago

robhudson commented 1 year ago

After the is_waitlist changes, we're seeing some sentry errors for unknown data for "fpn_country".

https://mozilla.sentry.io/issues/4087704376/?project=6260602&query=is%3Aunresolved&referrer=issue-stream&stream_index=0

leplatrem commented 1 year ago

The following data is posted:

email: [Filtered]
format: H
fpn_country: br
lang: en
newsletters: guardian-vpn-waitlist
source_url: https://www.mozilla.org/en-US/products/vpn/invite/

When the slug guardian-vpn is sent, we should consume fpn_* fields.

Same as relay-vpn-bundle and relay-phone-masking slugs, which should consume relay_* fields.

The piece of code responsible of "converting" data is this one: https://github.com/mozmeao/basket/blob/cdab6d102bf5d3d87c8b2efbf186b21ada60de77/basket/news/backends/ctms.py#L236-L248

This is a bug, and I don't find appropriate tests in test_ctms.py. We can fix this. Please assign the issue to me.

robhudson commented 1 year ago

We deployed the change and are still seeing these warnings come through in Sentry.