Repository navigation
Conversation
3a3722a8 is sendspin-cpp#218 as merged, which adds application-specific roles. It brings #234, which removes ConnectionTrust and on_trust_changed() for SendspinClient::is_paired(). The main loop now polls it and logs "Connected server is paired/not paired" when a session is new or re-keyed, as the callback did. status reads it before is_connected(), as the library asks. Its trust line loses "unknown": a connected session is always paired or not.
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Clearing server_id_ on the first connected tick can discard a newly started pairing attempt and incorrectly report pairing: none; the callback ordering needs a fix and regression test.
1 open issue
What changed in this PR
Updates sendspin-cpp to 3a3722a8, enabling the application-role support needed for local pairing in #110, and migrates pairing state to the new is_paired() API.
Changes:
- Re-pins the dependency and updates the roadmap reference.
- Replaces trust callbacks with main-loop polling and direct pairing-state reads for status.
- Updates status formatting and tests to remove the
unknowntrust state.
| File | Description |
|---|---|
tests/control_test.cpp |
Tests paired, unpaired, and disconnected status values. |
src/main.cpp |
Polls pairing state and migrates status snapshots to is_paired(). |
src/control.h |
Replaces optional trust with a pairing boolean. |
src/control_common.cpp |
Formats trust using connection and pairing state. |
docs/ROADMAP.md |
Updates the documented dependency pin. |
CMakeLists.txt |
Pins sendspin-cpp to 3a3722a8. |
Review effort: Balanced
Comment on lines
+159
to
+161
| if (connected && (!this->connected_ || paired != this->paired_)) { | ||
| // A new handshake: an attempt the last connection dropped never reported its end. | ||
| this->server_id_.clear(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Why
sendspin-cpp#218 merged as
3a3722a8. It addsSendspinClientConfig::application_roles, which #110 needs for local pairing. Moving the pin there also brings sendspin-cpp#234, which removesConnectionTrustandon_trust_changed()in favour ofSendspinClient::is_paired(), so the pin cannot move without this migration.What
3a3722a8, 31 commits pastb0fcf5bb.PairingListenerdrops the callback and pollsis_paired()once per main-loop tick, reading it beforeis_connected()as the library asks. It still logsConnected server is paired/not pairedwhen a session is new or has been re-keyed, and still clears a stale pairing attempt then.statusreadsis_paired()beforeis_connected()too. Thetrustline ispaired,unpairedornot connectedas before.unknownis gone: a connected session is always one or the other.docs/ROADMAP.mditem 3 names the new pin.Compatibility
No flag, config key, control-socket message, state format or exit code changes. The only visible difference is that
statusno longer printstrust: unknown.Testing
Ubuntu 24.04, Release,
-DSENDSPIN_CLI_WERROR=ON, ALSA, PulseAudio, PipeWire, PortAudio and Avahi, fresh FetchContent:scripts/format.sh --check: every file is formatted.--versionreportssendspin-cpp 3a3722a8….ctest: 554 of 557 pass. The three failures areStateStore.AnUnwritableDirectoryFails,AFailedWriteIsNotRememberedAsASuccessandWritesVolumeAndMuteInOneGo. Each makes a directory read-only and expects a write to fail, and the run was as root, which writes regardless. This PR doesn't touch the state store, and CI runs them unprivileged.scripts/smoke_test.sh: every check passed.