Unify CClient/CServer as a single orchestration layer behind UI and JSON-RPC
Avaliação
- Dificuldade
- 5/5
- Tempo estimado
- Mais de uma semana
- Facilidade para iniciantes
- 35/100
- Tipo de issue
- Refatoração
- Clareza
- Razoavelmente clara
- Status de atividade
- Pouca atividade
- Stack de tecnologia
- c
- Domínio
- api, backend-api-design, desktop
Direção de pesquisa
Comece rastreando CConnectDlg e CClientRpc em torno do exemplo do diretório atual e, em seguida, inspecione como CClient, CServer, CClientSettings e CServerSettings atualmente possuem ou expõem o estado. Migre incrementalmente um estado ou uma ação por vez, mantendo a funcionalidade existente funcionando; considera-se concluído quando a UI e JSON-RPC consumirem a mesma camada de orquestração, com paridade e sem lógica duplicada de ownership.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Summary
Currently, Client and Server capabilities and states are scattered across UI and other classes rather than "owned" centrally.
This issue proposes refactoring so that CClient and CServer become the single source of truth for all state and actions, with both the Qt UI and the JSON-RPC interface acting as symmetric, parity consumers of that layer - nothing more.
(This came out of discussion on #3660 - and prior discussions - where a small RPC addition (getCurrentDirectory/getDirectories) surfaced duplicated logic between CConnectDlg and CClientRpc that should really live in one place.)
Goals
- Clear separation of concerns between orchestration logic and presentation/control interfaces.
CClientandCServeras the orchestration core - the single arbiter of all Client/Server capabilities, state, and actions.- Full parity between UI and JSON-RPC. Anything the UI can do, JSON-RPC can do, and vice versa. No interface-specific logic duplicated across them. This should be sufficient, for example, to let someone write a local JSON-RPC + React (or any other) frontend that fully replaces the Qt UI.
CSettings/CClientSettings / CServerSettingsencapsulated behindCClientandCServer, rather than read or mutated directly by UI or RPC code.
Proposed pattern
Using "current directory" as a worked example:
CClientowns the state (e.g. current directory index) and exposes it via a canonical accessor.- UI components (e.g.
CConnectDlg) emit a signal on user interaction (e.g. "selection changed"). CClienthandles the signal and updatesCClientSettings.CClientSettingsemits its own change signal.- Both the UI and
CClientRpclisten and react independently — UI updates its display, RPC pushes new state to subscribers.
Neither the UI nor RPC owns logic the other doesn't have equal access to; both sit on top of the same CClient-owned state and signals.
Scope of JSON-RPC control
There is no remaining debate on how much should be controllable via JSON-RPC: full parity with the UI is the goal, including actions that affect other clients on a server (e.g. join/leave, mute). Restricting RPC to read-only, or to a subset of UI actions, would defeat the purpose — it would prevent RPC or other future mechanisms from being a viable full replacement for the UI.
Scope of exposure (local control)
Jamulus should continue to expose JSON-RPC only to the host machine itself. However, what the operator of that machine chooses to do with that local API - including running their own server-side bridge to expose a remote UI - is entirely outside Jamulus's domain and not something Jamulus needs to secure against. Jamulus's responsibility ends at the local socket; anything built on top (e.g. a remotely-accessible UI) is the hosting user's own responsibility.
Non-goals / explicitly out of scope for this issue
- Ripping out CLI parsing and Settings persistence on the Server side (raised as a related but separate, larger job).
- The longer-term "Jamulus as a DAW plugin" direction (bridges to Reaper/Audacity, etc.) — interesting, but a much bigger and more speculative rewrite than this issue is scoped for.
Whilst out of scope, it's hoped that the change in architecture will help towards both.
Why now
This is a foundational refactor that unblocks a class of feature requests (e.g. setCurrentDirectory, directory management setters) that keep surfacing in feature PRs and forcing the same "should this be centralized" conversation each time. Doing it once, centrally, avoids repeating this discussion piecemeal across future PRs.
Suggested approach
Incremental, in parallel with existing functionality — migrate one area of state/action at a time (starting with connection/directory handling, per the example above) into CClient/CServer ownership, with the existing UI and RPC code updated to consume it, rather than a big-bang rewrite. Keep the current implementation working throughout.
- Linguagem predominante
- C
- Estrelas
- 1.1k
- Forks
- 250
- Merge médio
- 9d 18h
- PRs com merge (30d)
- 4
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de jamulussoftware/jamulus
-
Move translation checker (and potentially other runners) to ARM runnerTalvez já em andamento @ann0see assumiu há 40 dias. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
jamulussoftware/jamulus#3953 · 2 comentários ·
-
AI
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
jamulussoftware/jamulus#3846 ·
-
Qt6 moving towards cmakeAbertafeature request
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 25/100
jamulussoftware/jamulus#3964 · 3 comentários ·
-
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 65/100
jamulussoftware/jamulus#3961 ·
-
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 76/100
jamulussoftware/jamulus#3958 ·
Todas as issues de jamulussoftware/jamulus
Issues semelhantes
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 85/100
-
build help wanted new feature
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 85/100
AOMediaCodec/SVT-AV1#2516 · 2 comentários ·
-
Windows ARM memory-leakAbertabug docs performance
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 85/100
Mantenedores costumam responder em até 3 dias
-
enhancement
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
toniebox-reverse-engineering/teddycloud#561 ·
Mantenedores costumam responder em até 1 dia
-
bug goto-symex
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 83/100
Mantenedores costumam responder em até 1 dia