зеркало из
1
0
Форкнуть 0
Граф коммитов

225 Коммитов

Автор SHA1 Сообщение Дата
Ludovic Rivallain 014440103e Fix: empty payload (#1105)
Closes #1081

Signed-off-by: Ludovic Rivallain <ludovic.rivallain@gmail.com>
2023-08-28 08:56:35 -07:00
Carter Tinney cde7259559 Removed unnecessary re-publish (#1067) (#1071) 2023-08-28 08:48:14 -07:00
Carter Tinney e248e9dcd9
Bump package versions for release on 2022-08-23 (#1043)
Co-authored-by: Azure IoT Client Build <aziotclb@microsoft.com>
2022-08-23 14:54:10 -07:00
Sebastian ada6ab929a
Fix minor typos (#1036) 2022-08-22 11:29:17 -04:00
Bert Kleewein c6a6ee7b5c
fix: Retry on TlsExchangeAuthError (fixes #990) (#1029) 2022-07-27 12:52:53 -07:00
Sebastian d5acff5776
fix: prevent infinite GetTwinOperation loop (#1023)
- Add connection logic to on_get_twin_complete
- Add appropriate unit tests
2022-07-20 14:50:52 -04:00
Sebastian 2cbbed5e92
chore: Edit logger.error calls (#1019)
* Edit logger.errors that don't need to be called as errors to warning or debug
2022-06-30 10:48:59 -04:00
Carter Tinney 268d4b34f2
refactor (azure-iot-device): Remove ConnectionLockStage (#1017)
* All remaining `ConnectionLockStage` functionality that was not already implemented by the `ConnectionStateStage` has now been moved there
2022-06-23 13:03:27 -07:00
Sebastian fb183b11f8
Add EnsureDesiredPropertiesStage kwarg (#1013)
- Added ensure_desired_properties to abstract_clients and shared_client_tests

- Added unit tests
2022-06-23 11:13:27 -04:00
Carter Tinney 63a327c27c
fix (azure-iot-device): Prevent duplicate twin GET upon Connect (#1016)
* Stages (except the MQTTTransportStage) now always invoke `.send_event_up`() at the _end_ of the `.handle_pipeline_event()` call
* Now that connection state has been improved by previous PRs, we no longer have to work around timing issues by invoking `.send_event_up()` early
* By doing things in the correct order, we now will no longer be accidentally republishing the twin GET that triggers upon connection
* Fixes #994
2022-06-22 10:21:39 -07:00
Carter Tinney 7ca9ffe643
fix (azure-iot-device): PipelineNucleus connection state is now the single source of truth regarding connection (#1014)
* Removed the boolean `.connected` attribute being set on the `PipelineNucleus` by the `PipelineRootStage`
* `.connected` is now a property that is derived from the `connection_state` attribute, which is set by the `ConnectionStateStage`
* This is now the single source of truth for the connection state
* Added additional testing fixtures to allow for easy mocking of the connection state
* Note that changes made to the `ConnectionLockStage` are merely a stopgap until the entire stage can be removed
2022-06-22 08:23:38 -07:00
Carter Tinney 6d08c986a7
refactor(azure-iot-device): ReconnectStage -> ConnectionStateStage (#1012)
* Renamed ReconnectStage to ConnectionStateStage
* Reduced footprint of the connection retry conditional
* Updated tests to account for new approach to connection retry conditional
* Updated logging
2022-06-17 09:51:53 -07:00
Carter Tinney d2fa4bb167
refactor(azure-iot-device): .pipeline_nucleus -> .nucleus (#1011) 2022-06-16 11:44:24 -07:00
Carter Tinney 539e12ad48
refactor(azure-iot-device): Added PipelineNucleus object (#1010)
* Added PipelineNucleus and refactored
2022-06-15 20:14:02 -07:00
Sebastian bdc391b4ae
Bugfix for KeyError when deleting pending response ID (#1008)
- Addresses KeyError message when enabling on_twin_desired_properties_patch_received
- Inconsistencies with how connection states are handled will be further addressed
2022-06-14 16:34:13 -04:00
Sebastian 9e98c663b7
chore: Fix typos (#1005)
* fixes typos

* Fix param

* Addressed PR feedback

Co-authored-by: Carter Tinney <carter.tinney@microsoft.com>
2022-05-24 13:04:50 -04:00
Bert Kleewein 4633219c67
Remove flake8 F401 and F403 global suppressions (#986) 2022-04-14 12:56:33 -07:00
Bert Kleewein 5021c0cb32
fix (azure-iot-device) Add MQTT_ERR_KEEPALIVE mapping to fix connection issues caused by new Paho error code (#981)
* fix (azure-iot-device) Add MQTT_ERR_KEEPALIVE mapping to fix connection issues caused by new Paho error code

* Add failure documentation to mqtt_transport.py and handle disconnect failures in the connection watchdog

* add tests for disconnect exception in watchdog handler
2022-03-30 13:36:39 -07:00
Carter Tinney 2891227e1b
fix(azure-iot-device): Added timeout to HTTP requests (#980) 2022-03-25 16:26:45 -07:00
Carter Tinney e2ab714bbf
release(azure-iot-device): 2.11.0 - 2022-03-24 (#979)
Co-authored-by: Azure IoT Client Build <aziotclb@microsoft.com>
2022-03-23 17:45:05 -07:00
Carter Tinney 6e566539ed
feature(azure-iot-device): Added support for user-provided gateway_hostname (#973)
* Added `gateway_hostname` user option to `.create_from_sastoken()`, `.create_from_x509_certificate()` and `.create_from_symmetric_key()` on the Device/Module IoTHub Clients
* Added `gateway_hostname` user option to all factory methods on the Provisioning Clients
* Added a ValueError that is raised if trying to use an X509 Connection String
2022-03-17 15:54:27 -07:00
Bert Kleewein b6f2f71720
Test: Add in-test leak tracking to E2E tests (#958)
* add leak checking inside tests

* move windows to 3.7
2022-03-01 21:19:47 -08:00
Carter Tinney 2f18ab94c9
fix(azure-iot-device): ClientEvent Memory Leak (#959)
* Fixed an issue where if no client event handlers were set (`on_connection_state_change`, `on_new_sastoken_required` or `on_background_exception`) ClientEvent objects could pile up in inboxes without being resolved
* Any ClientEvents that occur before a handler is set will now be lost. This was always the intended design, however.
2022-03-01 14:05:37 -08:00
Carter Tinney 2cd083f327
chore(azure-iot-device): Remove support for Python 2.7 and 3.5 (#952)
* Disallow install on those versions of Python
* Removed dependencies that are no longer necessary
* Removed `ChainableExceptions` in favor of using built in `raise from` functionality
* Removed `CallableWeakMethod` as Python 3 garbage collection will be sufficient
* Adjusted error handling where different versions of Python raised different errors
* Simplified `pipeline_thread` logic
* Removed references to 2.7 and 3.5 in documentation and samples
* Moved to Python 3-style `super()` invocations
* Removed custom implementation of `urlencode` in favor of using built-in `urlencode`
* Removed support for universal wheels
* Adjusted unittests that had Python 2.7 or 3.5 specific logic
* Removed Python 2.7 jobs from gate and canary
2022-02-22 15:56:57 -08:00
olivakar 8d43814a58
Bump package versions for release on 2022-02-10 (#950)
Co-authored-by: Azure IoT Client Build <aziotclb@microsoft.com>
2022-02-10 16:31:12 -08:00
Carter Tinney 38ff51d090
doc(azure-iot-device): README updates (#946)
* Updated sync documentation

* async patch doc

* Fixed init

* Updated READMEs

* more change

Co-authored-by: Bert Kleewein <BertKleewein@users.noreply.github.com>
2022-02-10 14:27:22 -08:00
Carter Tinney 62398cd7b6
fix(azure-iot-device): Prevented thread crash if SasToken refresh fails (#944)
* Added error catch

* Added error catch

Co-authored-by: Bert Kleewein <BertKleewein@users.noreply.github.com>
2022-02-10 13:39:19 -08:00
Carter Tinney e49fb689ea
feature(azure-iot-device): Removed use of socks library in API (#942)
* Removed the need for the user to use constants from the socks library in the ProxyOptions API
* Updated samples accordingly
2022-02-08 14:38:57 -08:00
Carter Tinney 47fcde5ab4
feature(azure-iot-device): Enabled server verification certs on ProvisioningClients (#941)
* Added support for server_verification_certs
* Added a couple missing tests
2022-02-08 13:22:00 -08:00
Bert Kleewein e82808eccb
fix(azure-iot-device): stack overflow in connection retry, simplify and improve stress tests (#943)
* fix stack overflow, simplify and improve stress tests

* PR feedback
2022-02-08 10:25:45 -08:00
Carter Tinney 2e7c3c1b1b
feature(azure-iot-device): Support for proxies in HTTPTransport (#930)
* Replaced the use of the HTTPSConnection client with the use of the requests library for HTTP operations in the Transport
* Enabled HTTP, SOCKS4 and SOCKS5 proxy support
* Fixed an issue where Content-Length header was not formatted as a string
* Added model-level validation for proxy type on ProxyOptions
2022-02-07 11:05:25 -08:00
Carter Tinney dd1cc544f2
fix(azure-iot-device): Reauthorization on wrong thread (#938)
Co-authored-by: Bert Kleewein <BertKleewein@users.noreply.github.com>
2022-02-03 16:38:47 -08:00
Carter Tinney 446ee6a3b5
fix(azure-iot-device): Alarm not offset by sleep (#913)
Alarms will now correctly trigger at the specified time, even if the system goes to sleep.
This was already supposed to have been implemented but apparently was not.
2021-12-06 13:22:17 -08:00
Carter Tinney 5413c86db1
fix(azure-iot-device): OverflowError for sufficiently long SAS expiry or retry interval (#912)
Fixed an issue where sufficiently long SAS token expiry or retry interval could cause a OverflowError due to exceeding the max value supported by a waiting thread
2021-12-03 15:17:49 -08:00
Carter Tinney 04c2033ef4
release(azure-iot-device): Bump version to 2.9.0 for release on 11-02-2021 (#898)
Co-authored-by: Azure IoT Client Build <aziotclb@microsoft.com>
2021-11-02 17:22:39 -07:00
Carter Tinney 1f61e5e5b5
fix(azure-iot-device): Remove double DisconnectEvent being issued in some cases (#895)
* Removed functionality whereby `MQTTTransportStage` would raise a `DisconnectedEvent` on Pub/Sub/Unsub attempts if the `MQTTTransport` raised an exception
* This was unnecessary because the `on_mqtt_disconnected` handler being attached to the `MQTTTransport` would already do this
2021-11-02 11:41:11 -07:00
Carter Tinney 734d7cfcb5
feature(azure-iot-device): Background Exception Handler (#857)
* Pipeline will now send background exceptions to the user via the on_background_exception handler
* Various fixes and refinements of exception flow in the pipeline
* Background exceptions from threading modules and the handler manager do not.
* Background exceptions from the pipeline are still also given to the original logging function
* Note that a bunch of unrelated tests had to be fixed as old error handling processes were allowing them to spuriously pass when they should have failed. With that process removed, they started to fail as they should have all along, and required fixing
2021-10-27 19:19:07 -07:00
Carter Tinney f54a3712c2
fix(azure-iot-device): Timeout now raises OperationTimeout (#872)
* Renamed the internal PipelineTimeoutError to OperationTimeout
* Added a user-facing exception also named OperationTimeout
* Fixed an issue where connection timeouts were raising OperationCancelled incorrectly, now will raise OperationTimeout
* Updated various docs and tests to reflect this
2021-10-12 17:02:55 -07:00
Carter Tinney f1481b1450
release(azure-iot-device): Bump package versions for release on 2021-10-08 (#866)
Co-authored-by: Azure IoT Client Build <aziotclb@microsoft.com>
2021-10-08 15:18:22 -07:00
Carter Tinney 091ffef8e0
fix(azure-iot-device): Ensured retry on auto SAS reauth failure (#865)
* Fixed a bug where if automatic reauthorization upon SAS refresh failed, it would not attempt it again
* Also fixed a few random typos and removed unnecessary comments
2021-10-08 14:27:03 -07:00
Carter Tinney 43c5fb66f6
fix(azure-iot-device): ReconnectStage State Machine Overhaul (#844)
* Auto-reconnect and SAS renewals should no longer cause problems if one or the other is turned off
* Operations now fail if they require a connection, and one cannot be automatically established
* All user-initiated actions should now return errors in case of failure rather than any kind of indefinite retry
* Created completely separate flows for automatic reconnection vs other connections
* Added more explicitness in conditional logic and improved documentation for clarity
2021-09-24 11:49:31 -07:00
Carter Tinney 2a604dcc2d
fix(azure-iot-device): Added missing docstrings for handlers (#853)
* Updated READMEs with missing information
* Added missing docstrings
2021-09-22 17:50:34 -07:00
Carter Tinney c6a7be37ec
fix(azure-iot-device): CONNACK Uniformity Act (#820)
* Adjusted Connect timeout to be 60 seconds to line up with Hub functionality
* Removed dead codepath for retrying Publish operations (not related to the above, but something I came across)
2021-07-12 16:44:23 -07:00
Carter Tinney d9c7ae1a96
feature(azure-iot-device): Added .on_new_sastoken_required handler (#813)
- Enabled the `.on_new_sastoken_required` handler
- Renamed the `SasTokenRenewalStage` to simply `SasTokenStage` (perhaps `SasTokenUpdateStage` would be preferable?)
- Added functionality to the `SasTokenStage` to fire an event indicating a new token is required
- Updated samples to show this new handler
- Also ended up black formatting a bunch of files that weren't black formatted (and have nothing to do with this PR)
2021-07-12 16:15:36 -07:00
Carter Tinney 9a34419a6c
chore(azure-iot-device): Removed the unused "Twin" model definition (#817) 2021-07-12 10:02:07 -07:00
Carter Tinney 74685bda70
chore(azure-iot-device): Reorganized handler property definitions (#793)
* Reduced duplication of code by moving handler property definitions to the abstract clients
* Reorganized order of definitions for clarity
* Added some missing internal docstrings
2021-06-21 11:19:12 -07:00
Carter Tinney f42798d256
Bump package versions for release on 2021-06-18 (#791)
Co-authored-by: Azure IoT Client Build <aziotclb@microsoft.com>
2021-06-18 17:29:09 -07:00
Carter Tinney ab8b9d1037
fix(azure-iot-device): Operations hanging after unexpected disconnect (connection retry disabled) (#787)
* When an unexpected disconnect occurs and connection retry is not enabled, in-flight operations will now be cancelled instead of hanging
* This is most notably in order to fix issues where quota is exceeded, but applies to other situations as well
2021-06-18 16:50:22 -07:00
Carter Tinney 78c358bd27
release(azure-iot-device): Bump package versions for release on 2021-06-04 (#783)
Co-authored-by: Azure IoT Client Build <aziotclb@microsoft.com>
2021-06-04 16:52:14 -07:00
Carter Tinney f40f99fddd
feature(azure-iot-device): Connection State Change Handler (#774)
* Refactored HandlerManagers to differentiate between the existing handlers for received data (now called Receiver Handlers) and the new Client Event Handlers
* Added infrastructure to support Client Event Handlers
* Implemented the .on_connection_state_change handler
* Within the HandlerManagers support has been added for upcoming .on_new_sastoken_required and .on_background_exception, but client or pipeline implementation of these handlers has not been added.
2021-06-01 17:02:28 -07:00