ParentWindow Resource race condition

I've been using the ParentWindow resource for a while to pass in session values to our retool apps that are embedded via their public access links and it's been working great until today.

I'm now seeing a race condition where even though the values are set in the encapsulating HTML, they don't seem to be getting picked up in our retool apps and they remain as empty values. If I keep refreshing the page and enter the public password, sometimes the values seem to update, but other times they do not and remain undetected by retool.

Has something changed in the way ParentWindow resources work recently? I'm using the "Run query automatically when inputs change" setting and have attached a screenshot of how I've configured the query.

Screen Shot 2022-02-28 at 9.55.07 PM

Hello Baback,

Thank you for writing in! So I'm not aware of any change made, but I will definitely consult with the team. When you refresh and log in and don't see the correct value, do you see any error messages in your browser console or in Retool?

Hoping to get this figured out soon!

John

Hey John,

Thanks for your response and looking into this.

I do get a stream of warnings in the console when I refresh, I don't recall seeing these before, but they also may have been there and I just never saw them. Happy to look for more error logs if you tell me where to look.

Hi @jSims,

I just looked at the errors specifically and I see failed postMessage calls on DOMWindow with target origin failing with 'null'. I imagine this is the problem we're running into. Looks like this a cross-site scripting issue...

We weren't running into it before any thoughts on how to fix?

Hello again,

I'm not aware of any change that we would have made that would have affected this, so we'll have to do some more digging!

Does this work in an incognito tab? Is every user affected and do they all see the same thing?

Also, in the parent window or wherever this is hosted, are there any CORS settings that you have control over?