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 unit value validation of delay node #3351

Merged

Conversation

HiroyasuNishiyama
Copy link
Member

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Proposed changes

Unit value of message rate limit is expected to be validated in delay node. But it do not work correctly.
This is caused by regexp matching that matches any input value.
This PR tries to fix this problem.

Checklist

  • I have read the contribution guidelines
  • For non-bugfix PRs, I have discussed this change on the forum/slack team.
  • I have run grunt to verify the unit tests pass
  • I have added suitable unit tests to cover the new/changed functionality

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.05%) to 67.337% when pulling e7189ab on node-red-hitachi:fix-delay-rate-unit-validation into 346db89 on node-red:master.

@knolleary
Copy link
Member

What the regex is trying to test for "is a number OR blank". I can't remember when this property was added, but we did not want the validation to mark old nodes as invalid because they didn't have this property set.

So I believe the appropriate fix is to change the regex to do what it was meant to do.

RED.validators.regex(/^(\d+|)$/)

@knolleary
Copy link
Member

So it looks like this property was added Node-RED < 0.15 - and the validator was modified via PR #996

I think at this point, it would be cleaner to go with your proposed change. I think the chances of a user having a flow from < 0.15 that they have never edited since are pretty tiny. And it would be better to have cleaner code.

So ignore my feedback - we'll go with this as you propose.

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.

None yet

3 participants