partytown icon indicating copy to clipboard operation
partytown copied to clipboard

fix: Avoids converting a gif into a function

Open leocwolter opened this issue 2 years ago • 4 comments

Summary

Fixes an issue where partytown prints an error when a third party scripts requests a resource different from a script.

Closes #245

leocwolter avatar Aug 25 '22 21:08 leocwolter

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
partytown ✅ Ready (Inspect) Visit Preview Aug 29, 2022 at 7:29PM (UTC)

vercel[bot] avatar Aug 25 '22 21:08 vercel[bot]

Open for ideas about how to test that since the expected behaviour is that a gif is requested with no other side effects. Is there a way to verify that using playwright? :sweat_smile:

Also, the integration that made us find that error was Google Adsense but that should happen everytime a script inside partytown requests something other than other script. Considering that, is it acceptable to make a test simulating that behaviour instead of trying to replicate using Google Adsense?

leocwolter avatar Aug 25 '22 21:08 leocwolter

This looks like a good fix, but what you also be able to add some tests to this to ensure it continues to work, and isn't breaking other tests?

adamdbradley avatar Aug 29 '22 16:08 adamdbradley

Finished the fixes and added end to end test @adamdbradley

leocwolter avatar Aug 29 '22 18:08 leocwolter

This is great, thanks so much for fixing this up!

adamdbradley avatar Sep 23 '22 11:09 adamdbradley