Skip to content

Enhance Connection Handling and Refactor Utility Functions #528

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

Merged
merged 4 commits into from
Feb 27, 2025

Conversation

pirropirro
Copy link
Collaborator

Motivation

This pull request introduces improvements and bug fixes to the Arduino IoT JS project. The changes enhance the functionality of cloud client connections, fix minor bugs, and refactor utility functions for better type handling.

Change description

  1. Added onConnect/onDisconnect Hooks in BaseCloudClient
    Support for onConnect and onDisconnect hooks has been added to the BaseCloudClient class to improve connection management.

  2. Removed Useless Logs
    Unnecessary logs have been removed to reduce verbosity and clean up the code.

  3. Fixed Minor Boolean Bug
    A bug related to incorrect handling of boolean values has been fixed to ensure proper data interpretation.

  4. Refactor Type Handling in src/senML/index.ts
    Type handling for values has been adjusted:

    • Numbers are now explicitly converted to type Number.
    • Strings are now explicitly converted to type String.
    • Booleans are now explicitly converted to type Boolean.
  5. Introduced isNil Function and Other Utility Improvements
    A new isNil function has been introduced to check for null or undefined values. Other utility functions for type checks (isNumber, isString, isBoolean, isArray) have been improved for better reliability.

Additional Notes

No specific Jira task or GitHub issue linked. However, these changes aim to improve connection handling and data consistency across the project.

Reviewer checklist

  • PR address a single concern.
  • PR title and description are properly filled.
  • Changes will be merged in main.
  • Changes are covered by tests.
  • Logging is meaningful in case of troubleshooting.
  • History is clean, commit messages are meaningful and are well formatted.

@pirropirro pirropirro merged commit 1235043 into master Feb 27, 2025
7 checks passed
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.

1 participant