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

The rec area seems to reload every time focus is changed #125

Open
Tracked by #112
yoavartzi opened this issue Feb 9, 2024 · 8 comments
Open
Tracked by #112

The rec area seems to reload every time focus is changed #125

yoavartzi opened this issue Feb 9, 2024 · 8 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@yoavartzi
Copy link
Member

image

This area seems to refresh every time I switch back from another. Or at least almost every time. It's a bit odd.

@yoavartzi yoavartzi added the bug Something isn't working label Feb 9, 2024
@yoavartzi yoavartzi added this to the UI overhaul milestone Feb 9, 2024
@swh00tw swh00tw mentioned this issue Feb 10, 2024
20 tasks
@yoavartzi
Copy link
Member Author

Seems to work fine now. So closing

@yoavartzi
Copy link
Member Author

Actually still doing this. Just switch back-and-forth to the browser tab to reproduce

@yoavartzi yoavartzi reopened this Aug 26, 2024
@github-project-automation github-project-automation bot moved this from Done to In Progress in Recnet Planning Aug 26, 2024
@swh00tw
Copy link
Collaborator

swh00tw commented Aug 26, 2024

Yeah I see same thing. I will prioritize this.

@yoavartzi
Copy link
Member Author

yoavartzi commented Aug 26, 2024

Actually, this is a broader problem. I also see it my profile page:
https://www.recnet.io/yoav

@swh00tw
Copy link
Collaborator

swh00tw commented Aug 27, 2024

Actually, this is a feature of the data fetching library not a bug. This is called refreshing the stale data. There's a case can explain why this mechanism is useful.

Let's say you open two recent tabs in your browser (no matter unconsciously or deliberately). You made a rec in tab 1. And then go to tab 2. If the refetchOnWindowFocus is true (which is the default behavior and the refreshing you observed now), the tab 2 will display the rec you just made. This mechanism actually made the data in multiple tabs in sync and prevent making double recommendations.

Screen.Recording.2024-08-27.at.3.39.20.PM.mov

If we disable this behavior (set refetchOnWindowFocus to false), double recommendations might happen and the browser tabs won't be in sync. Users need to manually refresh the page to make tabs in sync.

Screen.Recording.2024-08-27.at.3.41.29.PM.mov

@swh00tw
Copy link
Collaborator

swh00tw commented Aug 27, 2024

@swh00tw
Copy link
Collaborator

swh00tw commented Aug 27, 2024

While I think we should retain the default refreshing behavior, we can actually disable the refreshing at the profile page if you want since, on that page, the data fetching only involves READ operation. The edge case I mentioned above won't happen. And even if multiple tabs aren't in sync, that doesn't really matter and hurts too much (users need to manually refresh the page).

@yoavartzi
Copy link
Member Author

This makes a lot of sense. Let's disable this for readonly pages, but keep it for input pages.

This probably happens more seamlessly in other websites though. Right?

I am worried about the logic for the recommendation entry panel area though. It's really an edge case, but I could be in the entry page in two tabs (after pressing "recommend a paper") and then submit two recs. I don't know what this will cause. Didn't try 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
Projects
Status: In Progress
Development

No branches or pull requests

2 participants