Closed Bug 1917542 Opened 1 year ago Closed 4 months ago

www.reddit.com - "Reddit" logo does not refresh the webpage after the 1st attempt

Categories

(Web Compatibility :: Site Reports, defect, P3)

Desktop
All

Tracking

(Webcompat Priority:P2, Webcompat Score:6, firefox147 affected)

RESOLVED FIXED
Webcompat Priority P2
Webcompat Score 6
Tracking Status
firefox147 --- affected

People

(Reporter: rbucata, Unassigned)

References

()

Details

(Keywords: webcompat:platform-bug, webcompat:site-report, Whiteboard: [webcompat-source:web-bugs][webcompat:sightline][webcompat:japan])

User Story

platform:windows,mac,linux,android
impact:feature-broken
configuration:general
affects:some
branch:release
diagnosis-team:DOM
user-impact-score:270

Environment:
Operating system: Mac OS X 10.15
Firefox version: Firefox 130.0

Steps to reproduce:

  1. Navigate to: https://www.reddit.com/
  2. Click on the on the logo situated in the page header
  3. Click again multiple times and observe

Expected Behavior:
The page refreshes after each click

Actual Behavior:
The page refreshes only after the 1st click

Notes:

  • Reproduces regardless of the status of ETP
  • Reproduces in Firefox Nightly, and Firefox Release
  • Does not reproduce in Chrome
  • F5 and browser refresh button works as expected

Created from https://github.com/webcompat/web-bugs/issues/141479

Severity: -- → S4
User Story: (updated)
Priority: -- → P3
User Story: (updated)

Profile of loading and clicking reddit logo upper left. It never reloads (different than report). Linux Fedora, local m-c build

https://share.firefox.dev/3ZqjVft

I see OnLocationChange, history operations, etc
I see a UserTiming marker for UserTiming — same-document-navigation:https://www.reddit.com/
My guess is that they're suppressing same-URL navigation on purpose. No idea why it doesn't happen all the time (it does for me), or why it's different on Chrome

Whiteboard: [webcompat-source:web-bugs] → [webcompat-source:web-bugs][webcompat:sightline]
Webcompat Priority: --- → P2
Webcompat Score: --- → 6

The site uses a polyfill for the Navigation API (see apply-polyfill-1c410a4f.js). The polyfill isn't loaded in Chrome, so that could be the source of the different behaviors between browsers.
However, suppressing same-URL navigation doesn't seem to be the default behavior of that polyfill, so there seems to be a site bug in that code path (if it's intended behavior then I wonder why they didn't also implement it in the code path that Chrome takes).

If I set a breakpoint in shell-2ee313a7.js at if ('replace' === e.navigationType) I see that e.navigationType is "push" in Firefox but "replace" in Chrome. If I then set e.navigationType to "replace" and resume, the page is reloaded in Firefox as well.

Here's a simple reproduction of that difference for e.navigationType: Go to https://hbenl.github.io/test/navigationtype/ (previously https://navigationtype.glitch.me/), open the web console, enable "Persist logs" and click the link in the page. In Firefox it will log push and in Chrome replace. So the root cause of the different behavior seems to be this polyfill setting a different navigationType than Chrome's native implementation.

This is the code for https://navigationtype.glitch.me/:

<script>
  import("https://cdn.skypack.dev/@virtualstate/navigation/polyfill.js").then(() => 
    navigation.addEventListener("navigate", e => console.log(e.navigationType))
  )
</script>
<a href=".">Click</a>

I've opened a GitHub issue for the polyfill: https://github.com/virtualstate/navigation/issues/43

So this is a combination of a missing feature (the Navigation API) and a bug in the polyfill that the site uses for that feature.
We could also create a sitepatch once there is a fixed version of the polyfill available.

Whiteboard: [webcompat-source:web-bugs][webcompat:sightline] → [webcompat-source:web-bugs][webcompat:sightline][webcompat:japan]

The polyfill has been fixed, so we could create a sitepatch.

User Story: (updated)

Hi Holger,
I wonder what the next step is here, now that the Navigation API is enabled in Nightly, but I still see loading problems when I click the logo. Nothing happens at all, no matter how many clicks I've done, which is different from the original report but still an issue. Thank you.

User Story: (updated)
Flags: needinfo?(hbenl)
Depends on: 1997962
No longer depends on: navigation-api
Depends on: 1998121

(In reply to Hsin-Yi Tsai (she/her) [:hsinyi] from comment #10)

now that the Navigation API is enabled in Nightly, but I still see loading problems when I click the logo.

Our implementation of the Navigation API has the same issue that the old polyfill has: the navigationType is set to push when it should be replace. I've opened Bug 1998121 for that.
I think we should fix the Navigation API and wait for it to ride the trains instead of creating a sitepatch (which may be hard to do).

Flags: needinfo?(hbenl)

Noting a site patch should not be needed for this, I have recently reached out directly and the site should be updated with the latest polyfill version.

This is still an issue using the latest Nightly

OS: macOS → All

I cannot reproduce this on the latest Nightly, however on Release and Beta is still reproducible.

@hbenl Should we keep this open for a possible uplift?

Flags: needinfo?(hbenl)

(In reply to Calin Tanase from comment #14)

I cannot reproduce this on the latest Nightly, however on Release and Beta is still reproducible.

@hbenl Should we keep this open for a possible uplift?

This is only a relatively minor issue (and the Navigation API is currently only enabled in Nightly), so I'll close this.

Status: NEW → RESOLVED
Closed: 4 months ago
Flags: needinfo?(hbenl)
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.