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
Try the following on master (harder to reproduce on production since you don't have control over when the cache is primed there):
Restart Calypso
Open a new incognito window
Enter view-source:https://wordpress.com/theme/mood (or use curl 😄)
Cmd+F canonical
Notice there's an occurrence for canonical (<link rel="canoncial" .../>)
Reload
Cmd+F canonical
Notice the (<link rel="canoncial" .../>) is gone.
That's because of the reset of documet-head's link subreducer that ROUTE_SET triggers.
Any fix to these issues also needs to keep the original motivation for #8224 in mind:
This pull request seeks to resolve an issue where document head state is not properly reset when navigating between screens. For example, if while viewing the Reader an unread count is assigned into the title, if I then navigate away from the Reader, that count will become stuck in the title.
I think our strategy for a fix should be roughly as follows:
Remove the dedicated unreadCount handling from the DocumentHead component and state. Arguably, DocumentHead should reflect the contents of the HTML head. unreadCount is simply reflected in the <title />, and it's not a very generic or widely used thing -- I think only the Reader uses it. Hence, I think it's fair to put the burden of managing unreadCount state on the consuming component rather than DocumentHead.
This will allow us to think differently about resetting all DocumentHead props on each ROUTE_SET change -- more specifically, I think it'll allow us to drop that resetting. The title (now including the unreadCount) is guaranteed to be updated by any <DocumentHead /> component or setTitle() call found on whatever route the user navigates to, meaning the unreadCount isn't going to linger (thus preserving the intention of Framework: Reset title (document head) state after navigating #8224). Removing the resets on ROUTE_SET should fix DocumentHead: reseting title on tab view changes #23924.
There are currently at least two issues with
DocumentHead
(or rather, the Redux state associated with it).Similar thing happens on
comments/all/{site}
when switching comment status, and/pages
when switching page status.Try the following on
master
(harder to reproduce on production since you don't have control over when the cache is primed there):view-source:https://wordpress.com/theme/mood
(or use curl 😄)canonical
canonical
(<link rel="canoncial" .../>
)canonical
<link rel="canoncial" .../>
) is gone.That's because of the reset of
documet-head
'slink
subreducer thatROUTE_SET
triggers.Any fix to these issues also needs to keep the original motivation for #8224 in mind:
I think our strategy for a fix should be roughly as follows:
unreadCount
handling from theDocumentHead
component and state. Arguably,DocumentHead
should reflect the contents of the HTML head.unreadCount
is simply reflected in the<title />
, and it's not a very generic or widely used thing -- I think only the Reader uses it. Hence, I think it's fair to put the burden of managingunreadCount
state on the consuming component rather thanDocumentHead
.DocumentHead
props on eachROUTE_SET
change -- more specifically, I think it'll allow us to drop that resetting. The title (now including theunreadCount
) is guaranteed to be updated by any<DocumentHead />
component orsetTitle()
call found on whatever route the user navigates to, meaning theunreadCount
isn't going to linger (thus preserving the intention of Framework: Reset title (document head) state after navigating #8224). Removing the resets onROUTE_SET
should fix DocumentHead: reseting title on tab view changes #23924.link
andmeta
should fix DocumentHead: Prevent resetting the page title at every route change #23961 (comment). It shouldn't matter much if they linger on the client side upon route switch./cc @Copons @gwwar @sirreal @a8dar
The text was updated successfully, but these errors were encountered: