mailchimp / Firebase

IO-4458: product partnerships team
Apache License 2.0
20 stars 18 forks source link

memberTagsHandler failing to synchronize tags #67

Open christoph-nimagna opened 1 year ago

christoph-nimagna commented 1 year ago

We have the firebase extension installed and set up (mailchimp/mailchimp-firebase-sync@0.5.2).

This morning, a new user signed up and was synchronized correctly to Mailchimp. However, the tags that were inserted with the initial user data were not synchronized to Mailchimp. Only a tag that was added later was synchronized.

The Firebase logs of the failing request show a Error: The requested resource could not be found with more details. They are attached below.

downloaded-logs-20230526-134237.zip

Btw: There were other users signing up today, too. And in these cases, the integration worked flawlessly...

barticus commented 1 year ago

Hi @christoph-nimagna ,

If you can, sharing an obfuscated config file/values would be great.

Thanks,

christoph-nimagna commented 1 year ago

@barticus

  • How long have you had the extension installed? Is this the first time you've seen this issue?

We're using the extension for around half a year now. However, I had to reinstall the extension two weeks ago because the most recent update didn't work automatically. It is not the first time that we see some tags not being updated.

  • How would the user have been created? E.g. via Firebase Auth or via Merge Fields?

The user gets created in Firebase through our application. This triggers the synchronization to create the same user in Mailchimp. Technically, I think the Firebase Authentication entry is created first, then, we have a users collection in Firestore which gets populated with the user details, including the entries relating to the tags.

If you can, sharing an obfuscated config file/values would be great.

Which config file are you referring to? The extension is configured as follows:

Cloud Functions location: europe-west6
Mailchimp OAuth Token: xxxx
Audience ID: xxx
Contact status: subscribed
Firebase Member Tags Watch Path: users
Firebase Member Tags Config:
{ "memberTags": ["newsletterStatus", "mailchimpEmailStatusTag", "windowsUserTag", "macosUserTag"], "subscriberEmail": "emailAddress" }
Firebase Merge Fields Watch Path: users
Firebase Merge Fields Config:
{ "mergeFields": {"firstName": "FNAME", "lastName": "LNAME" }, "subscriberEmail": "emailAddress" }
Firebase Member Events Watch Path: _unused_
Firebase Member Events Config: {}

Some of the tag fields may not exist when the user gets created. However, this is not an issue with the users where it actually works. Do you need additional information?

barticus commented 1 year ago

Thanks for the details @christoph-nimagna . My biggest concern is that we changed over the library making the calls to Mailchimp to a Mailchimp supported one, and I was wondering if the old one had an inherent retry mechanism that the new library does not. We may try to introduce a retry option which would help in this case where the tags can't be set off an initial document creation as the user is not yet in Mailchimp (as I'm guessing they are processed in the background, or something)

barticus commented 1 year ago

I realised the above comment doesn't hold, the version of the extension with @mailchimp/mailchimp_marketing integrated has not been released yet.

Nevertheless, we will put in some retry functionality to allow Mailchimp API some time to process a new member before trying to update it.

It would be nice if the error message is more specific, from googling around this could be from a few different things not existing.

christoph-nimagna commented 1 year ago

@barticus - this is now a couple of months old and still not working on our side. Do you have an update on this?

barticus commented 1 year ago

Hi @christoph-nimagna ,

I have put in place the retry logic, unfortunately we've been having some challenges deploying the extension and we've been going through Firebase support but it has been a very slow process. There are a few fixes in that build I'm keen to get deployed.

I followed up again with them today, hopefully I hear back soon 🤞 Apologies it's been so delayed.

barticus commented 1 year ago

The retry functionality is in v0.5.4, currently sitting in "Sent for Review". Hopefully that helps with the resolution of this.

barticus commented 1 year ago

v0.5.4 is now available on the extensions hub, let me know how it goes!

christoph-nimagna commented 1 year ago

@barticus - I just updated now and will check if the problem is resolved. That might take a while to see if we don't experience bad cases anymore.

barticus commented 1 year ago

Hi @christoph-nimagna , thats fine, I'll leave this open for the moment, please let me know in the next week or two.

christoph-nimagna commented 6 months ago

@barticus - we didn't experience no issues any more. With that, let's close this issue.