Skip to content
New issue

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

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

Already on GitHub? # to your account

Fix refresh not working for React-based views #2537

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pjeby
Copy link
Contributor

@pjeby pjeby commented Mar 7, 2025

The existing code had a race condition that let it get into a state where no further updates could take place. This revision ensures that the view remains subscribed so long as the container element remains unchanged. (It also removes the extra initialization state and lastReload state, relying on the fact that the refreshOperation is only triggered when a view transitions from hidden to visible, or when the index is changed.)

This should reduce the number of React refreshes, as well as the overhead of repeatedly subscribing (and then unsubscribing) to the various events.

The existing code had a race condition that let it get into
a state where no further updates could take place.  This
revision ensures that the view remains subscribed so long
as the container element remains unchanged.  (It also removes the
extra initialization state and lastReload state, relying on the
fact that the refreshOperation is only triggered when a view
transitions from hidden to visible, or when the index is changed.)

This should reduce the number of React refreshes, as well as
the overhead of repeatedly subscribing (and then unsubscribing)
to the various events.
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant