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

Improve how the fetch_status.has_found_newest is set when loading a view from cache #30023

Open
timabbott opened this issue May 8, 2024 · 1 comment
Labels
area: message feed (scrolling) Scroll behavior, performance, and side-effects (marking as read) area: refactoring difficult Issues which we expect to be quite difficult

Comments

@timabbott
Copy link
Sponsor Member

This logic is wrong/not ideal, in that it doesn't check whether fetch_status.has_found_newest is true.

export function process_visible() {
    if (
        message_lists.current !== undefined &&
        viewport_is_visible_and_focused() &&
        message_viewport.bottom_rendered_message_visible() &&
        message_lists.current.view.is_fetched_end_rendered()
    ) {
        process_scrolled_to_bottom();
    }
}

See a2fe33a for detailed context on why the state of affairs is what it is today.

Fixing this likely involves extending the fetch_status structure to be capable of tracking the state of "We think we have all the latest messages, but are asking the server to double-check our understanding anyway."

See https://chat.zulip.org/#narrow/stream/9-issues/topic/message.20list.20doesn't.20load.20newer.20messages.20when.20near.20end/near/1795139 for detailed context.

We could also think about working towards revisiting the behavior of unconditionally always asking the server about older messages in a given conversation; if we're able to clean out certain categories of bugs, in theory that should not be necessary a lot of the time thanks to extensive local caching.

@timabbott timabbott added area: refactoring difficult Issues which we expect to be quite difficult area: message feed (scrolling) Scroll behavior, performance, and side-effects (marking as read) labels May 8, 2024
@zulipbot
Copy link
Member

zulipbot commented May 8, 2024

Hello @zulip/server-refactoring members, this issue was labeled with the "area: refactoring" label, so you may want to check it out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: message feed (scrolling) Scroll behavior, performance, and side-effects (marking as read) area: refactoring difficult Issues which we expect to be quite difficult
Projects
None yet
Development

No branches or pull requests

2 participants