Handle QoS2 messages when the library loses state - store state in NVM

Đang mở
#271 6 bình luận 0 reaction 0 người được giao Xem trên GitHub

@guclumhg đang làm issue này rồi.

Từ ngày 10/7/2026.

  • #379 của @guclumhg — đang mở

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
15/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
c
Lĩnh vực
embedded-iot, networking

Hướng nghiên cứu

Start by reading the QoS2 receive flow and how MQTT_ProcessLoop handles MQTT_PACKET_TYPE_PUBREL when outgoingPublishRecords is empty. The issue names no files or tests, so locate the relevant code and tests in the repository. Done means the client handles a reboot between receiving a QoS2 message and receiving PUBREL without returning MQTTBadResponse; the linked open pull request indicates work is already underway.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

enhancement help wanted

It is a very narow corner case but stil it breaks the client and renders it unusable.

  1. coreMQTT client is running on an embedded device, it subscribed to a topic with QoS2.
  2. The issue happens when a message is received and then the device reboots (for unrelated to coreMQTT reasons).
  3. When it boots again and re-connects to the broker it immidiately receives MQTT_PACKET_TYPE_PUBREL but since the device was rebooted the library has no knowleadge of the packet it received before, outgoingPublishRecords is empty and MQTT_ProcessLoop returns MQTTBadResponse.

Q: How would you suggest to handle a situation like this? There are no public functions in the library to get the failed packet id and to get access to outgoingPublishRecords structure that one could simply inject a record with id and MQTT_PACKET_TYPE_PUBCOMP type to let go that record. In the corner case like this I guess it's ok to lose the record since not much you can do if device reboots.

Ngôn ngữ chính
C
Star
239
Fork
131
Merge trung bình
6 giờ 51 phút
Pull request đã merge (30 ngày)
6

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của FreeRTOS/coreMQTT

Tất cả issue của FreeRTOS/coreMQTT

Issue tương tự

Thêm issue về C

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.