Contact attributes intermittently fail to get set

I'm using Airship to set a user_tier attribute on a contact. I first set a named user id on the contact and then set the attribute as follows:

UAirship.shared().contact.identify(namedUser)
UAirship.shared().contact.editAttributes().setAttribute("user_tier", userTier).apply()

The above code runs each time the user logs into or out of an account within my app. The named user changes as well. There is one named user value for the logged in state and another named user value for the logged out state.

I've been running a test where I log into and out of an account multiple times, and each time I will look at the Airship console to verify that the user_tier attribute has been set to the correct value. I'm using the contact lookup feature of Airship to verify this. I've been looking up the contact by channel id, but looking up by named user works as well.

There appears to be an intermittent issue where the user_tier attribute isn't being set. Meaning it doesn't show up in the attributes list in the contact lookup. I've verified through logging and through network traffic inspection that the call to set the user_tier attribute is indeed being made, and it even returns a 200 OK response. And yet I don't see it show up in the attributes list in the contact lookup.

Does anybody know what might be causing this? Is it possible that there's some kind of race condition that occurs as a result of calling identify and setAttribute back to back like I'm doing above?

Didn't find what you were looking for?

New post

Comments

1 comment

  • Hi Morris,

    Thanks for reaching out to Airship Technical Support! Registration API calls (SMS/Email/Open Channel, Named User Associations, Tag/Attribute Updates) may take time to fully process in our systems even though we return successful status with an identifier.

    As such, subsequent calls using the newly registered identifier may fail if that identifier is used immediately after registration. For example, registering a new SMS channel and then associating it to a Named User. You may receive a successful response on the initial request and get a Channel ID returned, however the Channel ID is returned as “Not Found” when attempting to associate.

    Depending on the reliability goals for your organization there can be a few options to address this concern:

    • Build an artificial delay into your requests between registration calls to increase the probability that the first call is successful
    • A more robust answer would be to make a GET request to the Channel ID or Named User ID Lookup API to ensure that the registration updates are correctly reflected and retry until it reflects correctly. This strategy is similar to what is implemented in our SDK based registrations (ie iOS, Android, Web).

    Reference Documentation: https://support.airship.com/hc/en-us/articles/360051990652-Best-Practices-for-the-use-of-the-Airship-Messaging-API#h_01EPWK474Q64N75E696N2EZ51K

    Let me know if you have any additional questions or concerns.

    Regards,

    Arushi S.
    Technical Support Engineer
    Airship | San Francisco, CA

    Comment actions Permalink

Please sign in to leave a comment.