ChorusHubServerInfo uses static field for discovered server, causing state leakage between instances
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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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