Need to diagnose Hosted Fields / Client initialization problems as they occur
See original GitHub issueGeneral information
- SDK version: 3.68.0
- Environment: Production
- Browser and OS: Several (here’s just 3 exanples)
Mozilla/5.0 (iPad; CPU OS 13_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 [FBAN/FBIOS;FBDV/iPad7,2;FBMD/iPad;FBSN/iOS;FBSV/13.7;FBSS/2;FBID/tablet;FBLC/en_US;FBOP/5]
Mozilla/5.0 (iPhone; CPU iPhone OS 13_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 [FBAN/FBIOS;FBAV/293.0.0.45.117;FBBV/252184617;FBDV/iPhone9,4;FBMD/iPhone;FBSN/iOS;FBSV/13.7;FBSS/3;FBID/phone;FBLC/en_US;FBOP/5;FBRV/253288080]
Mozilla/5.0 (Linux; Android 9; LM-Q720) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.110 Mobile Safari/537.36
Note: We do most advertising on Facebook, and the Facebook browser normally works fine so that’s not the issue.
Issue description
We are getting quite a few emails from customers saying they couldn’t enter their credit cards. These are turning out to be the dreaded HOSTED_FIELDS_TIMEOUT error. I have tried both ways of client creation (standalone and internally to hosted fields) and don’t see any difference. I cannot reproduce on my machine.
I expect the failure reasons would be in these sort of categories:
- Firewall issue
- Connectivity issue.
- Slow connection. Our site is loading fast even on users with issues (I log the DOMComplete time).
- Issue your end with creating a client that never returns.
- Weird browser plugin issues. We get errors on mobile and desktop and obviously plugins are less prevalent on mobile.
Based on my detailed logging the errors are not occurring after the user has navigated away - since I don’t log in that case.
I have just about exhausted the debugging I am able to do myself and our customers are external so I cannot reproduce. It seems that looking at data for the past month we sometimes are getting 5-10% of customers with timeouts.
I’ve also seen cases where the customer has tried refreshing the page themselves (so they definitely have connectivity) and tried 2-5 times they’re still getting the hosted fields error each time.
What I really need is some combination of the following:
-
A way to send a correlation ID (UID) when I create hosted fields that I could submit to support to look for analytics events. I see there’s an existing ‘sessionId’ but I don’t seem to be able to access that.
-
A way to set shorter timeouts for hosted fields. Expecting a user to wait 60 seconds is crazy. Of course this doesn’t help my problem unless the rejected promise has useful information.
-
Logging of internal events for client and hosted field setup that I could access any time after attempting to create an instance of the iframe. I think this is the only way I could truly find the problem.
For example this is the sort of thing I would like to see in a log. The idea being you would be able to see where it got stuck:
{
log: [
{
date: 'Thu Oct 29 2020 11:34:02 GMT-0700 (Pacific Daylight Time)',
desc: 'Create iframe'
},
{
date: 'Thu Oct 29 2020 11:34:03 GMT-0700 (Pacific Daylight Time)',
desc: 'Iframe created OK'
},
{
date: 'Thu Oct 29 2020 11:34:04 GMT-0700 (Pacific Daylight Time)',
desc: 'Graph QL Sent',
data: {
sessionID: '3649b9fb-9936-4adf-934e-555cb79ab537',
operation: 'ClientConfiguration'
}
},
{
date: 'Thu Oct 29 2020 11:34:06 GMT-0700 (Pacific Daylight Time)',
desc: 'Graph QL Received',
data: {
requestID: 'trOsRnXvk97FTdTaQ9q734dYoBEHbH0SwBrFQojtZsp8iVUj3_TMvg',
operation: 'ClientConfiguration'
}
}]
}
Having access to this would make it far easier to diagnose. Right now it’s almost impossible. Let’s say if hosted fields is still not set up after 15 seconds I could call hostedFields.log
and be able to access the log (even before the timeout). I don’t want to wait a whole minute, in which time the user may have already given up.
I was also wondering if would help for me to call the ‘ping’ service on your graphql to confirm connectivity is available? I just don’t know who would be blocking your domain unless it’s a really strict government or internal network.
Yes I did submit a support request but I only asked for our analytics to be looked at - perhaps you are already recording something that could help find the root cause. And yes I’ve seen other similar issues, but those seem to have been resolved.
Issue Analytics
- State:
- Created 3 years ago
- Comments:11 (6 by maintainers)
Top GitHub Comments
I’m going to close this issue then, but feel free to comment again if there’s more info for us to investigate.
Nothing intentional. I wouldn’t expect the update to Framebus v5 to resolve anything regarding this.