Skip to content

Take decibel 1.0 - #199

Merged
bbangert merged 1 commit into
mainfrom
claude/dazzling-wright-kltp7i
Sep 21, 2026
Merged

bbangert merged 1 commit into
mainfrom
claude/dazzling-wright-kltp7i

Conversation

@bbangert

@bbangert bbangert commented Sep 21, 2026 •

Copy link
Copy Markdown
Owner

Bumps decibel 0.2.4 → 1.0.1 (~> 0.2 → ~> 1.0) and moves UniversalProxy.Sendspin.Noise onto the 1.0 API.

  • Accessor renames — 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-errors gate.
  • Opaque handles — the struct's :ref is typed Decibel.session() rather than reference(). Our own ref!/1 owner check stays; it names the Sendspin session in the error, and a test asserts on that.
  • Truncated messages — a short handshake message used to escape as a MatchError; 1.0 raises DecryptionError with reason: :truncated. read_handshake/2 now reads the reason, so it still returns :malformed_handshake for a short message and :decrypt_failed for one that fails to authenticate. That also makes the ArgumentError rescue in decrypt/2 dead code, so it's removed — a sub-tag-length frame is :truncated now.
  • close/1 is no longer idempotent — a second close raises SessionError where 0.2 silently deleted nothing. Source.close_noise/1 already 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

@bbangert
bbangert force-pushed the claude/dazzling-wright-kltp7i branch from eba4845 to ecf1a9c Compare September 21, 2026 22:45
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
bbangert force-pushed the claude/dazzling-wright-kltp7i branch from ecf1a9c to 1913b4b Compare September 21, 2026 22:46
@bbangert
bbangert requested a balanced review from Copilot September 21, 2026 22:47

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@bbangert
bbangert merged commit 5a967dc into main Sep 21, 2026
7 checks passed
@bbangert
bbangert deleted the claude/dazzling-wright-kltp7i branch September 21, 2026 22:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants