Skip to content

Conversation

@vladfrangu
Copy link
Member

E2EE for voice connections is becoming mandatory anyways, so might as well mark the dependency as mandatory. And, should we, in the future, get more variants for dave implementations, we can adjust the code to support them

@vercel
Copy link

vercel bot commented Jan 18, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Review Updated (UTC)
discord-js Skipped Skipped Jan 25, 2026 8:24pm
discord-js-guide Skipped Skipped Jan 25, 2026 8:24pm

Request Review

@codecov
Copy link

codecov bot commented Jan 18, 2026

Codecov Report

❌ Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 31.87%. Comparing base (3550b49) to head (c9815aa).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
packages/voice/src/networking/DAVESession.ts 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #11385      +/-   ##
==========================================
- Coverage   32.07%   31.87%   -0.21%     
==========================================
  Files         375      375              
  Lines       13720    13676      -44     
  Branches     1078     1068      -10     
==========================================
- Hits         4401     4359      -42     
+ Misses       9184     9182       -2     
  Partials      135      135              
Flag Coverage Δ
structures 41.26% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@coderabbitai
Copy link

coderabbitai bot commented Jan 18, 2026

📝 Walkthrough

Walkthrough

This change converts @snazzah/davey from a development-only dependency to a runtime dependency and refactors the code to use static imports instead of lazy loading. The Davey module is now imported directly at compile time rather than being dynamically loaded with runtime availability checks.

Changes

Cohort / File(s) Summary
Dependency Configuration
packages/voice/package.json
Moved @snazzah/davey from devDependencies to dependencies, making it a runtime requirement.
Module Import Refactoring
packages/voice/src/networking/DAVESession.ts
Replaced dynamic lazy-loading mechanism with static direct import. Removed daveLoadPromise and runtime module availability check. Updated getMaxProtocolVersion to access Davey directly without optional chaining. Removed constructor error handling for unavailable module. Added ts-expect-error annotation in decrypt method to address const enum export compatibility.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: moving the Davey dependency from devDependencies to dependencies due to E2EE becoming required.
Description check ✅ Passed The description explains the rationale for the change (E2EE becoming mandatory) and acknowledges future extensibility considerations related to the changes.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

📜 Recent review details

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0171769 and a92eb3b.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (2)
  • packages/voice/package.json
  • packages/voice/src/networking/DAVESession.ts
🔇 Additional comments (4)
packages/voice/package.json (1)

66-66: Runtime dependency move makes sense for required Davey.
This aligns with the new mandatory E2EE requirement.

packages/voice/src/networking/DAVESession.ts (3)

61-62: Direct protocol version lookup looks good.


365-366: MediaType is a runtime export and safe to access.

@snazzah/davey v0.1.8 exports MediaType at runtime (via module.exports.MediaType = nativeBinding.MediaType), so Davey.MediaType.AUDIO will not be undefined. The code is safe.

Likely an incorrect or invalid review comment.


3-3: No action needed. The default import of @snazzah/davey is correct and will work at runtime. The package is a native N-API addon that exports CommonJS, which Node.js automatically exposes as a default export when consumed from ESM. The import syntax is compatible and will not break.

Likely an incorrect or invalid review comment.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Member

@almeidx almeidx left a comment

Choose a reason for hiding this comment

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

These need to be updated:

**DAVE Protocol Libraries (e2ee)**
> [!NOTE]
> Some Discord clients may require the DAVE protocol for end-to-end encryption in voice chat and refuse to downgrade the connection in the future. Ensure you have `@snazzah/davey` installed to avoid compatibility issues.
- `@snazzah/davey`: ^0.1.6

#### DAVE Protocol Support
- [`@snazzah/davey`](https://www.npmjs.com/package/@snazzah/davey) - to enable end-to-end encryption with the DAVE protocol.
<Callout>
Some Discord clients already require the DAVE protocol for end-to-end encryption in voice chat. Ensure you have
`@snazzah/davey` installed to avoid compatibility issues.
</Callout>

@github-project-automation github-project-automation bot moved this from Todo to Review in Progress in discord.js Jan 18, 2026
@github-project-automation github-project-automation bot moved this from Review in Progress to Review Approved in discord.js Jan 25, 2026
@vercel vercel bot temporarily deployed to Preview – discord-js-guide January 25, 2026 20:24 Inactive
@vercel vercel bot temporarily deployed to Preview – discord-js January 25, 2026 20:24 Inactive
@kodiakhq kodiakhq bot merged commit 323d8e7 into main Jan 25, 2026
28 checks passed
@kodiakhq kodiakhq bot deleted the voice/make-davey-required branch January 25, 2026 20:28
@github-project-automation github-project-automation bot moved this from Review Approved to Done in discord.js Jan 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Bug: @discordjs/voice DAVE protocol check fails when getMaxProtocolVersion() returns undefined

6 participants