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

fix: more lenient initial sync #839

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

Commits on Sep 18, 2024

  1. fix: more lenient initial sync

    When you join a project, you wait for some data to sync, such as the
    project config. That effectively happens in two steps:
    
    1. If sync is already done, return.
    2. Otherwise, listen for sync state updates, and return when sync is
      done.
    
    Before this change, these two steps answered "is sync done?" in slightly
    different ways. After this change, they answer that in the same way.
    
    Here's a diff in pseudocode:
    
    ```diff
     function waitForInitialSync() {
       if (!wantsDataFromOtherPeers()) return 'done'
    
       onSyncState(() => {
    -    if (isSyncCompletelyFinished()) {
    +    if (!wantsDataFromOtherPeers()) {
           return 'done'
         }
       })
     }
    ```
    
    More specifically, this makes both parts check "is sync done?" by
    looking at the `auth` and `config` namespaces. If they want nothing but
    have something, we consider them done with initial sync.
    EvanHahn committed Sep 18, 2024
    Configuration menu
    Copy the full SHA
    ab0e61a View commit details
    Browse the repository at this point in the history