-
Notifications
You must be signed in to change notification settings - Fork 248
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How can I change default timeout for ACK_TIMEOUT? #49
Comments
We use it on a Shopify plugin, and the XComponentInit send a request to shopify side. |
You could try Is your code hosted somewhere I can read/try? Also -- messages in xcomponent are restricted by domain. If this a problem with one env and not another, my suspicion would be that there's some mismatched domain. What settings are you using in the component definition? |
I'm guessing this is the module: https://github.com/PostCo/postco-shopify/commits/master Noticed you reverted xcomponent back to an old version. Were you seeing this issue only with the latest? |
@bluepnume Yes, it only happens on the newer versions, on local development it is fine, maybe it is fast enough, but on production, it sends the request to Shopify. The plugin is mounted on the client Shopify shop's cart page. I can only confirm this problem happens on v1.0.70, v1.0.80, and v1.0.100. Not sure for the other versions. And it works fine on v1.0.63. |
Oh right, so xcomponent uses the specified url to decide which domain to listen to messages from. Can you try setting Are you expecting shopify to send callbacks up to you, through xcomponent? |
Will close this issue soon, let me know if there are any more updates on your side. |
I don't expect Shopify to send callback through xcomponent, but I mount them to different Shopify shops, so I assume I am expecting it. |
Hi Andy. Sorry, didn't get a notification for this thread back when you replied. Did you have any luck getting your use-case to work? If not, please share some example code so I can try to help. |
@bluepnume I have this error only in IE 11 "Error: No ack for postMessage xcomponent_init in 1000ms" Connector = xcomponent.create({
tag: 'connector',
url: "[url to my html page]",
dimensions: {
width: '800px',
height: '400px'
},
contexts: {
popup: true
},
defaultLogLevel: 'warn',
props: {
getAccessTokenAsync: {
type: 'function',
required: true
},
selectedAppId: {
type: 'string',
required: false
},
selectedConnectionId: {
type: 'string',
required: false
},
onSuccess: {
type: 'function',
required: true
},
onFailure: {
type: 'function',
required: true
}
}
}); "\xcomponent\demo\basic\popup\index.htm" seems to be working fine in IE 11 so I'm going to have to investigate further |
@harouny are you using xcomponent.js or xcomponent.frame.js? For popup messaging to work in IE11, you need to set up a bridge for post-messages to go through. It's annoying but there's no other good way :(
I'll add some fuller docs for this soon... |
@bluepnume |
Let me know if you run into any problems. Also added #86 to make this a more obvious failure. |
@bluepnume |
Sorry It will be in the bridge only....thanks :) |
@harouny -- only when you load post-robot in the In fact -- you can avoid dealing with post-robot directly just by loading xcomponent or your component in the frame. So in step b) you could load |
I think a) and b) need to be swiched for clarity |
I agree in the context of xcomponent. When I add bridge docs over here, there's probably no need to mention post-robot at all. (In fact if you feel like contributing any docs here, please feel free!) |
Sure mate, I will. Thanks |
@bluepnume if (!this.driver.needsBridge) {
return;
} But I haven't seen in code anywhere we set driver.needsBridge Any ideas? |
So, just to be sure -- you're running this in IE, and you're trying to load a component on a different domain, right? It'll only try to load the bridge if it detects IE.
|
Yes, IE and loading a component on a different domain via a popup |
I was gonna point to the code location, then I realized it's not actually there. I think this got missed out in some refactoring. Lemme quickly double check this. |
OK, cool, somehow good news :) |
OK try the latest code :) removed that check, it's redundant. As usual, great catch. |
Bridge is working now, thanks for the quick fix! |
Cool! Going to close this now. |
Hey, Encountered the same issue with my project. Attempted to follow the above steps to no avail. Here's what I did exactly:
With the above, the error Anyone able to see where I've gone wrong? Thanks, |
Hi @AlbinoDrought,
It works well at my end (post-robot v8.0.14 and xcomponent v6.0.37). HTH, |
I got this error on production environment, but not locally.
Uncaught Error: No ack for postMessage xcomponent_init in 1000ms
I'm here to ask how can I provide the timeout. Thank you.
The text was updated successfully, but these errors were encountered: