Skip to content

Fix crash and stale delivery state on truncated/halted patch notifications - #197

Open
yurique wants to merge 2 commits into
jbr7rr:devfrom
yurique:fix/packet-parsing-and-stale-state
Open

yurique wants to merge 2 commits into
jbr7rr:devfrom
yurique:fix/packet-parsing-and-stale-state

Conversation

@yurique

@yurique yurique commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

fixes #194

Notification parsing:

  • field-size table and up-front length check - prevent crashes; short payload keeps the state and drops all fields
  • validate bolus/basal/reservoir values, verify patch ID
  • handle 1- and 2-byte notifications: take the state byte

Delivery state:

  • finalize the running basal and record a suspend whenever the patch state is halted
  • don't re-emit notifications on every sync

…tions (jbr7rr#194)

Notification parsing:
- field-size table and up-front length check - prevent crashes;
  short payload keeps the state and drops all fields.
- validate bolus/basal/reservoir values, verify patch ID.
- handle 1- and 2-byte notifications: take the state byte.

Delivery state:
- finalize the running basal and record a suspend whenever the patch state is halted
- don't re-emit notifications on every sync.

Co-authored-by: claude and gpt
# Conflicts:
#	MedtrumKit/PumpManager/PeripheralManager.swift
@yurique

yurique commented Sep 5, 2026

Copy link
Copy Markdown
Contributor Author

merge conflicts resolved

@mountrcg

Copy link
Copy Markdown

Both issues didnt occur yesterday when my pod ran dry. Basal rate got recorded as 0 even thou algo said non-zero, no crash. So for me fixed.

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.

Crash (SIGTRAP) in NotificationPacket mask handlers

2 participants