Take decibel 1.0 - #199
Merged
Merged
Take decibel 1.0#199
Conversation
bbangert
force-pushed
the
claude/dazzling-wright-kltp7i
branch
from
September 21, 2026 22:45
eba4845 to
ecf1a9c
Compare
Decibel 1.0 renamed its accessors, made sessions opaque owner-checked
handles, and gave every peer-message failure a stable exception with a
machine-readable reason. Our Sendspin Noise wrapper moves with it:
* is_handshake_complete?/1 and get_handshake_hash/1 become
handshake_complete?/1 and handshake_hash/1. The 0.2 names survive as
deprecated aliases, but deprecation warnings fail the
--warnings-as-errors compile gate, so the renames are not optional.
* The struct's :ref is Decibel.session() (an opaque handle carrying its
owner), not a bare reference().
* A truncated handshake message used to escape as a MatchError from the
token reader; 1.0 raises DecryptionError with reason: :truncated. The
rescue now reads the reason so read_handshake/2 keeps returning
:malformed_handshake for a short message and :decrypt_failed for one
that fails to authenticate. The same change makes the ArgumentError
rescue in decrypt/2 dead code — a sub-tag-length frame is :truncated.
The rest of 1.0's breaking changes don't reach us: we run the
interactive KKpsk2 pattern (the one-way transport-direction rule is for
N/K/X), we never supply :e/:re or call set_nonce/3 or :registry, and
Wire already fragments at 65535 minus the AEAD tag, which is exactly
1.0's transport plaintext limit.
One behaviour change worth naming: close/1 is no longer idempotent —
a second close raises SessionError instead of silently deleting nothing.
Source.close_noise/1 already rescued, so teardown is unaffected, but
both sides now say the rescue is required.
muontrap 2.0 is not in this change: nerves_time 0.4.12 and
vintage_net 0.13.12, both at their latest, still require
muontrap ~> 1.0, so hex resolution rejects it.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
bbangert
force-pushed
the
claude/dazzling-wright-kltp7i
branch
from
September 21, 2026 22:46
ecf1a9c to
1913b4b
Compare
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The migration consistently handles the API and behavior changes without unresolved issues.
Review effort: Balanced
Findings: None
What changed in this PR
Upgrades Decibel to 1.0.1 and adapts Sendspin Noise integration to its updated API and error semantics.
Changes:
- Migrates renamed Decibel accessors and opaque session types.
- Preserves handling for truncated messages and repeated session closure.
- Updates tests and peer helpers to use the 1.0 API.
| File | Description |
|---|---|
| test/universal_proxy/sendspin/noise_test.exs | Uses the renamed handshake hash accessor. |
| test/support/sendspin_source_peer.ex | Updates peer handshake hash calls. |
| mix.lock | Locks Decibel 1.0.1. |
| mix.exs | Requires Decibel 1.0. |
| lib/universal_proxy/sendspin/noise.ex | Adapts the wrapper to Decibel 1.0 behavior. |
| lib/universal_proxy/audio/input/source.ex | Documents repeated-close error handling. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
Bumps
decibel0.2.4 → 1.0.1 (~> 0.2→~> 1.0) and movesUniversalProxy.Sendspin.Noiseonto the 1.0 API.is_handshake_complete?/1→handshake_complete?/1,get_handshake_hash/1→handshake_hash/1, in the wrapper and in the two test files that drive decibel directly as the initiator. The 0.2 names survive as deprecated aliases, but deprecation warnings fail our--warnings-as-errorsgate.:refis typedDecibel.session()rather thanreference(). Our ownref!/1owner check stays; it names the Sendspin session in the error, and a test asserts on that.MatchError; 1.0 raisesDecryptionErrorwithreason: :truncated.read_handshake/2now reads the reason, so it still returns:malformed_handshakefor a short message and:decrypt_failedfor one that fails to authenticate. That also makes theArgumentErrorrescue indecrypt/2dead code, so it's removed — a sub-tag-length frame is:truncatednow.close/1is no longer idempotent — a second close raisesSessionErrorwhere 0.2 silently deleted nothing.Source.close_noise/1already rescued and several teardown paths can reach the same session twice, so behaviour is unchanged, but that rescue is now load-bearing and both sides say so in a comment.🤖 Generated with Claude Code