OpenClaw / imsg
Merged upstreamCorrectnessMerged Sep 29, 2026

Verify canonically equivalent sent text

Moved text equivalence out of SQLite's byte-sensitive predicate and into Swift's canonical String comparison while retaining outgoing, time, and chat constraints in SQL.

openclaw/imsg · #321

Messaging correctness

Imsg no longer reports a delivered accented-text message as an uncertain failure when Messages stores an equivalent Unicode normalization form.

Problem

Messages can store sent text in a canonically equivalent decomposed form. SQLite compared the stored bytes with the precomposed request and discarded the row before Swift could recognize equivalence, causing a delivered message to return may_have_completed after the verification timeout.

Approach

Broadens the scoped SQL candidate query by removing exact text equality, then relies on the existing decoded Swift comparison to match canonical equivalents. Regression cases cover NFC, NFD, and mixed-normalization strings.

Impact and scope

  • Prevents callers from treating successfully delivered accented-text messages as uncertain failures or retrying them unnecessarily.
  • Uses Swift's canonical String equality instead of trying to enumerate normalization forms in a byte-sensitive SQL predicate.
  • Preserves chat, timestamp, direction, and decoded-text checks, keeping the candidate set bounded and final matching exact at the text level.
  • Documents the corrected behavior and credits the original reporter in the project changelog.

Validation

  • Both new normalization regressions failed on the baseline and passed with the fix; all eight focused sent-message lookup tests passed.
  • Full macOS and Linux CI, debug and release builds, standalone archive smoke tests, formatting, and documentation checks passed; no live Messages sends were performed for validation.
  • The functional commit is authored by Goutam Adwant, all four hosted checks passed, and the maintainer closed GH-320 with explicit credit for the fix.