Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Web] Users sometimes taken back to previous URL (or blank page) when clicking some links #710

Closed
ichthyos opened this issue May 17, 2023 · 20 comments · Fixed by #2955
Closed
Assignees
Labels
bug Something isn't working repro-needed We've been unable to confirm the issue x:planned We're on it!

Comments

@ichthyos
Copy link

Describe the bug

Intermittently, clicking on Home or Profile makes the browser leave bluesky and navigate to the page that my browser was on before bluesky.

To Reproduce

Steps to reproduce the behavior are unclear, but I experience the bug after clicking on Home or Profile in the navigation on the left hand side.

Expected behavior

I would be taken to the appropriate page in bluesky.

Screenshots

N/A

Details

  • Platform: Desktop Chrome Windows
  • Platform version: Version 113.0.5672.93 (Official Build) (64-bit)
  • App version: Latest at https://staging.bsky.app/

Additional context

Not sure whether navigation to other pages (Search, Notifications, Moderation, Settings) are affected by the same bug.

@ichthyos ichthyos added the bug Something isn't working label May 17, 2023
@DavidBuchanan314
Copy link
Contributor

I've had this happen several times too, but also having trouble finding a reliable way to reproduce it. Something that might be related is that toggling between Following and What's Hot does not push a history state.

@pfrazee pfrazee added the x:planned We're on it! label May 19, 2023
@TheUnlocked
Copy link

TheUnlocked commented Jun 16, 2023

It feels like the history is being improperly memoized somehow. Try the following steps and print out history.state.id in the console beforehand and after pressing each button.

  1. Home -> Search -> My Feeds -> Notifications -> My Feeds
  2. Press back, goes to search (not notifications)
  3. Press back, goes to home

history.state is managed by react-navigation so it's possible this is an upstream issue, or it could just be some subtle bug with how bluesky invokes react-navigation.

@tinymoons-dev
Copy link

I've experienced the same issue, but I can't reliably reproduce the behavior.

Windows, Chrome Version 114.0.5735.199 (Official Build) (64-bit)

@estrattonbailey estrattonbailey changed the title Sometimes clicking on Home or Profile causes the browser to navigate back in session history, leaving bluesky (web) [Web] Users sometimes taken back to previous URL (or blank page) when clicking some links Aug 15, 2023
@estrattonbailey estrattonbailey added the repro-needed We've been unable to confirm the issue label Aug 15, 2023
@estrattonbailey
Copy link
Member

Update: we're aware this is an issue but have been unable to reproduce as of yet. We'll keep this issue open and in the backs of our minds until we're able to figure out what's causing this 👍

@Zero3K
Copy link

Zero3K commented Aug 25, 2023

I am able to replicate it. Pressing Shift + F5 causes the page to show properly.

@ansh
Copy link
Contributor

ansh commented Sep 11, 2023

@Zero3K Can you please provide reproduction steps?

@Zero3K
Copy link

Zero3K commented Sep 11, 2023

I do not know how I got it to happen.

@deceptionagent
Copy link

deceptionagent commented Feb 14, 2024

i can reproduce this on demand in Safari on macOS:

  1. open a new blank browser window.
  2. enter google.com into the address bar and go. (any non-bsky.app site is fine, you just need a backstop in the history that will demonstrate the bug.)
  3. go to http://bsky.app
  4. click Notifications
  5. click any notification
  6. click the browser's back button
  7. click that notification again
  8. click the reply button on the single-post page that loads
  9. click Cancel in the reply panel
  10. click Home

--> your browser will now jump back to your backstop page.

the bug reproduces 100% of the time for me with these steps.

@Bossett
Copy link
Contributor

Bossett commented Feb 14, 2024

reproduces as described on Chrome 121 (Win 11)

@mozzius
Copy link
Member

mozzius commented Feb 14, 2024

can reproduce on Firefox 122.0.1 (macOS Sonoma)

@mozzius
Copy link
Member

mozzius commented Feb 14, 2024

Seems opening the composer is not necessary - you can skip steps 8 and 9.

I can also reproduce going google -> bsky.app -> search -> a suggested profile -> back -> a suggested profile -> home

@deceptionagent
Copy link

yeah i'm betting there are several ways to get here. i only spent a few minutes attempting to reduce it further.

i had tried a version without the composer and the bug didn't reproduce. i must have made a mistake while trying to reduce it. oops. :)

@goeo-
Copy link

goeo- commented Feb 14, 2024

ohhhh this is why it seems to happen more on mac,, because people actually use the two finger swipe to go back. on Mouse Requiring OSes i am way more likely to click on the back arrow in the app instead of on the browser.

@gaearon
Copy link
Collaborator

gaearon commented Feb 14, 2024

Fantastic, thank you for the repros. This should make it a lot easier to diagnose. Anyone wants to dig into the source?

@n0vedad
Copy link

n0vedad commented Feb 14, 2024

It seems to be related to the fact that when you click on a post and NOT click the back arrow but click the home button, sometimes it takes you to your last position in your timeline, or sometimes it takes you to the top of your timeline (without fetching new posts)

@SlickDomique
Copy link

You don't have to search at all. bsky -> any page -> back -> any other page -> home also triggers it

Weirdly enough this is not triggering any navigation events, only beforeunload gets triggered when this happens

@mozzius
Copy link
Member

mozzius commented Feb 14, 2024

I can replicate this on other react navigation sites (for example https://evanbacon.dev )

Edit: here's a short thread where I tried to debug the issue https://bsky.app/profile/www.mozzius.dev/post/3kleujracen2d
TL;DR: it's react-navigation issue with handling the back button

@SlickDomique
Copy link

It's happening somewhere in or after batchedUpdates in react-dom

@SlickDomique
Copy link

I further described the bug and have submitted potential fix to the react-navigation repository. The linked issue contains very simple repo with this issue replicated and a video showing the problem.

react-navigation/react-navigation#11832

@haileyok
Copy link
Contributor

@SlickDomique Thank you! Applying your patch for now while we wait for it to get merged in. Thanks for digging into it!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working repro-needed We've been unable to confirm the issue x:planned We're on it!
Projects
None yet
Development

Successfully merging a pull request may close this issue.