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

Arguments checking bug #21

Open
4refr0nt opened this issue Oct 7, 2016 · 10 comments
Open

Arguments checking bug #21

4refr0nt opened this issue Oct 7, 2016 · 10 comments
Labels

Comments

@4refr0nt
Copy link
Contributor

4refr0nt commented Oct 7, 2016

If you pass retain = false when publish, then retain is true.
Disabling retain flag only if retain option is undefined

                var options = {}
                options.topic = topic;
                options.payload = msg;
                options.qos = 0;
                options.retain = false;
                options.success = function() {};
                options.error = function() {};

                cordova.plugins.CordovaMqTTPlugin.publish(options)
@arcoirislabs
Copy link
Owner

We will fix the issue soon

@snr-lab
Copy link

snr-lab commented Jul 24, 2017

So there are two bugs in cordova-plugin-mqtt.js file.

  1. When you assign false to retain flag for publishing message it is always gets true. To fix this bug we need to update following line.

(args.retain===undefined) ? (args.retain=false) : (args.retain=true);
To
(args.retain===undefined) ? (args.retain=false) : "";

  1. For will message configuration also retain flag always gets to true. To fix this bug we need to update following line.

args.willTopicConfig.retain||true
To
args.willTopicConfig.retain === undefined ? true : args.willTopicConfig.retain

This will not be affected for the value undefined as it already handled previously.

I have created a PR for this retain issue, please approve it.

@arcoirislabs
Copy link
Owner

@snr-lab Thank you for the PR. Just wanted to know that have you verified completely ??

@snr-lab
Copy link

snr-lab commented Jul 26, 2017

Thank you very much for accepting my PR.
I am developing an mqtt app and I am verifying the plugin repeatedly.

I got one bug with my fix when will message is not configured. I have fixed the issue and raised the PR. Please approve it.

@snr-lab
Copy link

snr-lab commented Jul 27, 2017

Can we mark this bug resolved as the issue is fixed?

@arcoirislabs
Copy link
Owner

arcoirislabs commented Jul 27, 2017 via email

@snr-lab
Copy link

snr-lab commented Jul 28, 2017

I found one more bug. When we set keep alive 0 it automatically get changed to 60000. According to the documentation 0 is also a valid input. It actually disables keep alive feature.

@spilz87
Copy link

spilz87 commented Aug 5, 2021

Hello

It seems the issue is still there
How to merge it in last release ?

@amaze-escape
Copy link

I can also confirm that the bug is still there...

@arcoirislabs
Copy link
Owner

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants