You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Features are de-inited too late on ajax navigation #6437
Hopefully this isn't visible at the moment, but it can be reproed. Paste this into a feature like quick-new-issue
voidfeatures.add(import.meta.url,{init(signal){console.log('xx: init');signal.addEventListener('abort',()=>{console.log('xx: deinit');});observe('a',()=>{console.log('xx: found new');},{signal});},});
Then:
Visit any repo page
Click on another tab
Expected log
xx: init
xx: found new (100)
xx: deinit
xx: init
xx: found new (100)
Current log:
xx: init
xx: found new (100)
xx: found new (50)
xx: deinit
xx: init
xx: found new (50)
The expectation is that there will be a PR on the page only on turbo:render, but in reality it's already there at turbo:frame-render, with no prior "unload" event that we can listen to.
Then with the browser buttons:
Go back
Clear console
Go forward
This works correctly, and it would allow to use before-render as the unload event (except that the URL is /pulls in every event)
I think listeners/observers could just be removed on the first turbo: event dispatched. The actual issue is likely the CSS features that would remove the body attribute too early and therefore cause a visual breakage until the page is actually changed. If they're covered entirely by addCssFeature I could either:
add an additional listener after that first signal abort
Activity
fregante commentedon Mar 30, 2023
Ajax events can be tracked with:
Use:
The expectation is that there will be a PR on the page only on
turbo:render, but in reality it's already there atturbo:frame-render, with no prior "unload" event that we can listen to.Then with the browser buttons:
This works correctly, and it would allow to use
before-renderas the unload event (except that the URL is/pullsin every event)fregante commentedon May 9, 2023
I might have found a related issue:
Easy repro:
conversation-activity-filter23.5.20 `conversation-activity-filter` style hotfix
23.5.10 `conversation-activity-filter` style hotfix
fregante commentedon Jun 20, 2024
I think listeners/observers could just be removed on the first
turbo:event dispatched. The actual issue is likely the CSS features that would remove thebodyattribute too early and therefore cause a visual breakage until the page is actually changed. If they're covered entirely byaddCssFeatureI could either:abortI'll try to look into it soon