Skip to content

Releases: eman/nwp500-python

v5.0.0

28 Oct 00:38
ec3f5df

Choose a tag to compare

What's Changed

  • feat: Enterprise Exception Architecture (v5.0.0) by @eman in #30

Full Changelog: v4.8.0...v5.0.0

v4.8.0

27 Oct 23:03
1b99bc7

Choose a tag to compare

What's Changed

  • Add Token Restoration Support for Session Persistence by @eman in #29

Full Changelog: v4.7.1...v4.8.0

v4.7.1

27 Oct 19:06

Choose a tag to compare

Full Changelog: v4.7...v4.7.1

v4.7: Two-Tier MQTT Reconnection & Code Quality Improvements

27 Oct 18:02

Choose a tag to compare

🚀 Major Improvements

Two-Tier MQTT Reconnection Strategy

  • Quick reconnection (attempts 1-9): Fast recovery from transient network issues
  • Deep reconnection (every 10th attempt): Full rebuild with credential refresh and subscription recovery
  • Unlimited retries: Never gives up permanently (changed from 10 max attempts to unlimited)
  • Deep reconnection includes token refresh with fallback to full re-authentication
  • Automatic re-establishment of all subscriptions after deep reconnection

Enhanced Error Handling

  • Replaced 25 catch-all exception handlers with specific exception types
  • Added safety checks for attribute access (hasattr() before e.name)
  • Proper exception types: AwsCrtError, AuthenticationError, TokenRefreshError, RuntimeError, ValueError, TypeError, AttributeError, KeyError
  • Only 1 legitimate catch-all preserved (EventEmitter for user callback resilience)

New Public API

  • NavienAuthClient.has_stored_credentials property - Check if credentials available for re-auth
  • NavienAuthClient.re_authenticate() method - Perform fresh sign-in with stored credentials
  • MqttSubscriptionManager.resubscribe_all() method - Restore all subscriptions after reconnection

Code Quality Improvements

  • Simplified nested conditions with local variables for readability
  • Optimized subscription recovery (break after first failure per topic)
  • Fixed subscription failure tracking to use sets for unique counting
  • Improved boolean expressions with intermediate variables
  • Added exception handling guidelines to Copilot instructions

Bug Fixes

  • Eliminated duplicate "Connection interrupted" log messages
  • Prevented redundant subscription retry logs

📊 Statistics

  • 350 lines added, 70 removed (+280 net)
  • 80/80 tests passing (100% pass rate)
  • Overall test coverage: 31%
  • Zero type errors (mypy)
  • All linting checks pass

🔧 Configuration

New configuration parameter:

MqttConnectionConfig(
    max_reconnect_attempts=-1,  # -1 = unlimited (default, changed from 10)
    deep_reconnect_threshold=10,  # Deep reconnect every 10 attempts (new)
)

🎯 Impact

  • Production-ready MQTT reconnection resilience
  • Never loses connection permanently
  • Handles expired AWS credentials gracefully
  • Cleaner, more maintainable codebase
  • Better error messages and debugging

Full Changelog: https://github.com/eman/nwp500-python/blob/main/CHANGELOG.rst

v3.1.4

26 Oct 15:17

Choose a tag to compare

What's Changed

  • Fix MQTT reconnection failures due to expired AWS credentials by @eman in #27

Full Changelog: v3.1.3...v3.1.4

v3.1.3

24 Oct 22:12
17fa1ee

Choose a tag to compare

What's Changed

  • Fix: Improve MQTT reconnection reliability with active reconnection by @eman in #26

Full Changelog: v3.1.2...v3.1.3

v3.1.2

24 Oct 01:28

Choose a tag to compare

What's Changed

  • Fix 401 authentication errors with automatic token refresh by @eman in #25

Full Changelog: v3.1.1...v3.1.2

v3.1.1

22 Oct 18:24

Choose a tag to compare

Full Changelog: v3.1.0...v3.1.1

v3.1.0

21 Oct 06:33
ce4695e

Choose a tag to compare

What's Changed

  • Refactor: PEP 257 docstrings, 80 char line limit, and comprehensive documentation by @eman in #24

Full Changelog: v3.0.0...v3.1.0

v3.0.0

20 Oct 00:52
13aba28

Choose a tag to compare

What's Changed

  • Fix all mypy strict mode errors by @eman in #23

Full Changelog: v2.0.0...v3.0.0