Skip to content

Conversation

@amtoaer
Copy link
Contributor

@amtoaer amtoaer commented Nov 1, 2025

If I understand this correctly: The active_repo_id uses get_or_insert_with, which makes it dependent on the RepositoryAdded event sequence. To ensure correct initialization of the active_repo_id on the remote side, the first local RepositoryAdded event must synchronously send an UpdateRepository to updates_tx.

Closes #30694

Release Notes:

  • Fixed incorrect default repository selection when using remote (let's git together)

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Nov 1, 2025
@cole-miller
Copy link
Member

Thanks! I think this solution makes sense--what do you think about sending that initial UpdateRepository message whenever a new repo is inserted locally, regardless of whether it's the first? That seems a little cleaner and has the benefit that the downstream side's repository list will populate more promptly (even if it doesn't get the actual git statuses, etc. until later).

@cole-miller
Copy link
Member

Thanks!

@cole-miller cole-miller merged commit fc3e503 into zed-industries:main Nov 4, 2025
24 checks passed
@esthertrapadoux
Copy link

Yeaaahhhh!!! Congrats @amtoaer !!

tomatitito pushed a commit to tomatitito/zed that referenced this pull request Nov 7, 2025
…ed-industries#41698)

If I understand this correctly: The `active_repo_id` uses
`get_or_insert_with`, which makes it dependent on the `RepositoryAdded`
event sequence. To ensure correct initialization of the `active_repo_id`
on the remote side, the first local `RepositoryAdded` event must
synchronously send an `UpdateRepository` to `updates_tx`.

Closes zed-industries#30694

Release Notes:

- Fixed incorrect default repository selection when using remote
@esthertrapadoux esthertrapadoux moved this to 🚢 Shipped by Community in Git board Nov 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement

Projects

Status: 🚢 Shipped by Community

Development

Successfully merging this pull request may close these issues.

Git: main repository should be default when submodules are present (SSH remote)

3 participants