Skip to content
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

fix: remove undefined user-properties before sending Packet #1970

Closed

Conversation

SoulKa
Copy link

@SoulKa SoulKa commented Feb 14, 2025

Changes

  • Remove undefined properties before sending packet

This fixes an error where the user sets a property to undefined which results in a TypeError (closes mqttjs/mqtt-packet#152).

@robertsLando
Copy link
Member

@SoulKa I don't think this should be done on mqttjs side, it should be the user that ensures the properties set are not undefined

@robertsLando robertsLando changed the title fix(1969): Remove undefined Properties before sending Packet fix: remove undefined Properties before sending Packet Feb 17, 2025
@robertsLando robertsLando changed the title fix: remove undefined Properties before sending Packet fix: remove undefined user-properties before sending Packet Feb 17, 2025
Copy link

codecov bot commented Feb 17, 2025

Codecov Report

Attention: Patch coverage is 33.33333% with 2 lines in your changes missing coverage. Please review.

Project coverage is 81.05%. Comparing base (57691cf) to head (b776a3a).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/lib/client.ts 33.33% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1970      +/-   ##
==========================================
- Coverage   81.15%   81.05%   -0.10%     
==========================================
  Files          24       24              
  Lines        1470     1473       +3     
  Branches      349      350       +1     
==========================================
+ Hits         1193     1194       +1     
- Misses        193      194       +1     
- Partials       84       85       +1     
Flag Coverage Δ
unittests 81.05% <33.33%> (-0.10%) ⬇️

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.

@robertsLando
Copy link
Member

@SoulKa I have moved the issue to mqtt-packet repo. Please open a PR there

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.

[Bug]: TypeError when setting Packet Property to undefined
2 participants