fix_lwm2m: do not send resources for reading if necessary #14052
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pull Request description
https://thingsboard-portal.atlassian.net/jira/software/c/projects/PROD/boards/33?assignee=5dd3fc93b63a210fb4b6b1c2&selectedIssue=PROD-6936
Fix: Duplicate Resource Read Requests During Client Registration
Problem:
During the client registration process, the system was sending duplicate read requests for resources. This occurred because we were sending read requests twice: once for attributes and telemetry, and a second time for observations. This led to unnecessary network traffic and increased the load on the LwM2M client.
Solution:
This pull request addresses the issue by implementing a new, more efficient strategy for sending read requests during client registration.
Prioritize Observation Requests: The process now first sends a request to observe all required resources.
Smart Read Requests: After the observation requests are sent, the system sends a separate batch of read requests for attributes and telemetry. A key improvement is that if a resource is already included in the observation request, a duplicate read request is not sent.
New Registration Strategy: We have introduced a new strategy for sending read requests during registration. This new strategy mirrors the logic used for observation requests, ensuring that the entire process is more streamlined and prevents redundant communication with the device.
These changes ensure that all necessary resource data is retrieved efficiently without any duplicate requests, significantly improving the performance and reliability of the client registration process.
General checklist
Front-End feature checklist
Back-End feature checklist