sillsdev / sillsdev/chorus

ChorusHubServerInfo uses static field for discovered server, causing state leakage between instances

Open
#376 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
5
Forks
26
PR merge metrics
No merged PRs in 30d

Description

ChorusHubServerInfo stores its discovered server in a static field (src/LibChorus/ChorusHub/ChorusHubServerInfo.cs):

private static ChorusHubServerInfo _chorusHubServerInfo;

All code paths that call FindServerInformation() — including SyncStartControl.CheckNetworkStatusAndUpdateUI — share this single instance. In test scenarios or when multiple independent sync sessions run in the same process, a stale server discovered by one session leaks into another. The existence of ClearServerInfoForTests() as a public workaround confirms this is a known design issue:

public static void ClearServerInfoForTests()
{
    _chorusHubServerInfo = null;
}

Fix: Convert _chorusHubServerInfo to an instance member, or restructure discovery to use a properly scoped pattern that does not share state across unrelated sessions.

Found via DeepWiki.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in src/LibChorus/ChorusHub/ChorusHubServerInfo.cs and trace FindServerInformation(), including its use from SyncStartControl.CheckNetworkStatusAndUpdateUI. Review how ClearServerInfoForTests() is used and identify the appropriate lifetime for discovered server information. Done means independent sync sessions no longer share stale discovery state, with affected callers and tests updated accordingly.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.