partytown icon indicating copy to clipboard operation
partytown copied to clipboard

test: multiple page tests for #492

Open techfg opened this issue 9 months ago • 8 comments

What is it?

  • [ ] Feature / enhancement
  • [X] Bug
  • [X] Docs / tests

Description

Tests to reproduce #492

Use cases and why

When multiple tabs/pages are open, the error $instanceId$ not found is encountered when attempting to access main thread. See #492 for details.

Checklist:

  • [X] My code follows the developer guidelines of this project
  • [X] I have performed a self-review of my own code
  • [ ] I have made corresponding changes to the documentation
  • [X] Added new tests to cover the fix / functionality

techfg avatar Nov 05 '23 02:11 techfg

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

Name Status Preview Comments Updated (UTC)
partytown ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 24, 2024 10:57am

vercel[bot] avatar Nov 05 '23 02:11 vercel[bot]

Thanks @techfg I'll resolve the conflicts.

gioboa avatar Jan 10 '24 10:01 gioboa

Thanks @techfg I'll resolve the conflicts.

Thanks @gioboa! Unfortunately, the merge resulted in two tests no longer failing so I've reverted back to the order of operations that existed from prior commit. In short, the bug that exists is whenever two (or more) tabs/pages are open, if you go back to the first page (and sometimes even on the 2nd), you'll encounter the error so it's important for both pages to be loaded and then interact with them.

This does seem to be a fairly significant issue as any time more than one tab/page is open on a site that uses PT, unless Atomics are used, the problem will arise. Any insight on when #492 could be looked at?

techfg avatar Jan 10 '24 19:01 techfg

May I suggest you to checking it out pls?

gioboa avatar Jan 11 '24 19:01 gioboa

May I suggest you to checking it out pls?

Sorry @gioboa, is question intended for me? If so, sorry, I don't understand what you'd like me to check out?

techfg avatar Jan 11 '24 20:01 techfg

Any insight on when #492 could be looked at?

I was referring to this.

gioboa avatar Jan 11 '24 20:01 gioboa

Any insight on when #492 could be looked at?

I was referring to this.

@gioboa - gotcha, thanks for clarifying. I was the one that created #492. I believe the root issue is in the way PT tracks instances but doesn't recognize multiple windows when posting messages back and forth. I'm not familiar with the core internals so was hopeful someone from PT team who's more familiar could review and resolve. Steps to easily reproduce issue are in #492. Thanks!

techfg avatar Jan 11 '24 20:01 techfg

@gioboa - Forgot to mention that when I initially found the issue and added the tests to reproduce, I did look in to what might be causing this. It was a while ago so can't recall exact details but I believe I found that when the 2nd (or any subsequent) window opens and PT loads, the information (e.g., instances) are dropped from the internal tracking mechanism and only the new window's instances remain which leads to the $instanceId$ not found errors.

techfg avatar Jan 16 '24 18:01 techfg