Skip to content

chore(WebSocketShard): improve zlib-sync errors #10808

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

LJNeon
Copy link

@LJNeon LJNeon commented Mar 18, 2025

Please describe the changes this PR makes and why it should be merged:
The current error thrown from zlib-sync isn't great, and doesn't match what errors from node:zlib look like. This brings them more in line with node:zlib errors.

Status and versioning classification:

  • Code changes have been tested against the Discord API, or there are no code changes
  • I know how to update typings and have done so, or typings don't need updating

@LJNeon LJNeon requested a review from a team as a code owner March 18, 2025 19:35
Copy link

vercel bot commented Mar 18, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
discord-js ⬜️ Ignored (Inspect) Visit Preview Jun 1, 2025 3:59pm
discord-js-guide ⬜️ Ignored (Inspect) Visit Preview Jun 1, 2025 3:59pm

@Jiralite Jiralite added this to the ws 3.0.0 milestone May 2, 2025
@Jiralite Jiralite requested a review from almeidx May 28, 2025 18:44
@LJNeon
Copy link
Author

LJNeon commented May 28, 2025

I can't reproduce that test failure locally, not sure what happened there?

@github-project-automation github-project-automation bot moved this from Todo to Review in Progress in discord.js May 28, 2025
Copy link

codecov bot commented Jun 1, 2025

Codecov Report

Attention: Patch coverage is 0% with 14 lines in your changes missing coverage. Please review.

Project coverage is 37.97%. Comparing base (4d19426) to head (78d30ac).
Report is 65 commits behind head on main.

Files with missing lines Patch % Lines
packages/ws/src/ws/WebSocketShard.ts 0.00% 14 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #10808      +/-   ##
==========================================
- Coverage   39.66%   37.97%   -1.69%     
==========================================
  Files         249      251       +2     
  Lines       15206    15987     +781     
  Branches     1456     1477      +21     
==========================================
+ Hits         6031     6071      +40     
- Misses       9163     9904     +741     
  Partials       12       12              
Flag Coverage Δ
core 0.89% <ø> (?)
ws 36.03% <0.00%> (+1.39%) ⬆️

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.

@iCrawl iCrawl requested a review from almeidx June 2, 2025 17:27
@github-project-automation github-project-automation bot moved this from Review in Progress to Review Approved in discord.js Jun 2, 2025
new Error(`${this.zLibSyncInflate.err}${this.zLibSyncInflate.msg ? `: ${this.zLibSyncInflate.msg}` : ''}`),
);
// Must be here because zlib-sync is lazily loaded
const ZlibErrorCodes = {
Copy link
Member

Choose a reason for hiding this comment

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

Cache this in a variable outside the class please, so its computed only once

@github-project-automation github-project-automation bot moved this from Review Approved to Review in Progress in discord.js Jun 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Review in Progress
Development

Successfully merging this pull request may close these issues.

7 participants