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: add option to reconnect if connack has an error code #1948

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

Conversation

mgabeler-lee-6rs
Copy link

@mgabeler-lee-6rs mgabeler-lee-6rs commented Oct 16, 2024

fixes #1947

  • Not sure about the naming of the new option
  • New option defaulting disabled to avoid surprise in consumers, but there's an argument to defaulting it on
  • Needs tests
  • Add documentation

Copy link
Member

@robertsLando robertsLando left a comment

Choose a reason for hiding this comment

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

The option name looks good to me. Remember to add tests and also docs

@mgabeler-lee-6rs mgabeler-lee-6rs marked this pull request as ready for review October 16, 2024 15:31
@mgabeler-lee-6rs
Copy link
Author

mgabeler-lee-6rs commented Oct 16, 2024

@robertsLando ✔️

I noticed the first pass the CI tests failed for various reasons that ... don't seem related to any changes I made? Esp. the internal error within the codecov uploader.

Edit: new runs failed the same way

@robertsLando
Copy link
Member

@mgabeler-lee-6rs I still don't understand why ci fails, could you try removing the test and push? Just to see if that's the reason

@mgabeler-lee-6rs
Copy link
Author

Trying that, but somehow I suspect that the problem is more likely related to building/uploading from a fork?

test/abstract_client.ts Outdated Show resolved Hide resolved
@mgabeler-lee-6rs
Copy link
Author

mgabeler-lee-6rs commented Nov 21, 2024

Was going to suggest contacting codecov for help, but I noticed this is using the nodejs uploader, which is deprecated to the point that the repo is archived

Might be worth looking into the github action they provide for this now

@robertsLando
Copy link
Member

That's what I tried here: #1943

But no clue why when I add that action workflow remains in wait state for no reason

@mgabeler-lee-6rs
Copy link
Author

mgabeler-lee-6rs commented Nov 21, 2024

checks on that PR show:

Annotations
1 error
Error
codecov/codecov-action@v4 is not allowed to be used in mqttjs/MQTT.js. Actions in this workflow must be: within a repository owned by mqttjs, created by GitHub, or matching the following: mqttjs-test, npm-publish, release-it, semantic-pr, amannn/action-semantic-pull-request@*.

Probably some repo security setting?

@robertsLando
Copy link
Member

robertsLando commented Nov 22, 2024

Oh god thanks sooo much for that! I think I lost 4 hours trying to debug that and I totally forgot we have some restrictions on actions that can run.... Could you tell me where you got those errors? I wan't able to see them

test/abstract_client.ts Outdated Show resolved Hide resolved
Copy link

codecov bot commented Nov 22, 2024

Codecov Report

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

Project coverage is 81.07%. Comparing base (1eed1b6) to head (5d8377f).

Files with missing lines Patch % Lines
src/lib/handlers/connack.ts 0.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1948      +/-   ##
==========================================
- Coverage   81.18%   81.07%   -0.12%     
==========================================
  Files          24       24              
  Lines        1467     1469       +2     
  Branches      348      349       +1     
==========================================
  Hits         1191     1191              
- Misses        192      193       +1     
- Partials       84       85       +1     
Flag Coverage Δ
unittests 81.07% <0.00%> (-0.12%) ⬇️

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.


🚨 Try these New Features:

@robertsLando
Copy link
Member

Ok I fixed tests and did a minor refactor, could you please fix conflicts? I moved all tests under test/node folder for consistency

@mgabeler-lee-6rs
Copy link
Author

Could you tell me where you got those errors? I wan't able to see them

I clicked into the Checks tab on the PR, and from there (on one of the older commits that failed), into the MQTT.js Tests on the left bar, which had a 🗨️ icon, which takes me to a page like https://github.com/mqttjs/MQTT.js/actions/runs/11968792492 which has that error at the bottom under the Annotations header.

could you please fix conflicts?

On it!

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]: Does not start reconnect timer on connection error
2 participants