fix: Accept inbox thread URLs#30
Conversation
## [1.6.4](v1.6.3...v1.6.4) (2026-06-16) ### Bug Fixes * accept inbox thread URLs ([#30](#30)) ([af8573e](af8573e))
|
🎉 This PR is included in version 1.6.4 🎉 The release is available on: Your semantic-release bot 📦🚀 |
doistbot
left a comment
There was a problem hiding this comment.
This PR extends parseCommsUrl to support inbox and saved thread URLs, cleans up the route-pair parsing loop, and adds parameterized regression tests.
Few things worth tightening:
- Make the
inbox/tandsaved/tbranches stricter so they only match at/{thread}segment with an optionalc/{comment}suffix; extra trailing segments should remain unclassified to prevent malformed URLs from being misrouted as conversations.
I also included a few optional follow-up notes in the details below.
Optional follow-up notes (2)
- [P3] src/lib/refs.ts:138: The repeated condition makes the intentional fall-through for paths like
inbox/doneeasy to miss. Grouping by the route prefix makes the distinct cases clearer and removes the duplicate array access:typescript const route = segments[routeStart] if (route === 'inbox' || route === 'saved') { if (segments[routeStart + 1] === 't') { parseRoutePairs(routeStart + 1) } } else { parseRoutePairs(routeStart) } - [P3] src/lib/refs.test.ts:291: Add
saved thread URLandsaved thread URL with comment suffixcases to match theinboxcoverage and the explicitly addedsaved/troute support.
| (segments[routeStart] === 'inbox' || segments[routeStart] === 'saved') && | ||
| segments[routeStart + 1] === 't' | ||
| ) { | ||
| parseRoutePairs(routeStart + 1) |
There was a problem hiding this comment.
🟡 P2 This reuses the generic pair parser for inbox/t and saved/t, so malformed URLs with extra route pairs are now accepted. For example, classifyCommsUrl('https://comms.todoist.com/20/inbox/t/TH1/msg/CV1') will return conversation and tdc view will route it, even though this isn't a valid conversation URL. Please parse these routes explicitly as t/{thread} with only an optional c/{comment} suffix, and leave any other trailing segments unclassified.
|
👍🏻 |
Only classify `t/{thread}` with an optional `c/{comment}` suffix after
inbox/saved; extra trailing segments stay unclassified so malformed URLs
aren't misrouted (e.g. as a conversation). Groups the branch by route
prefix and adds saved-thread + strictness test coverage.
Addresses review on #30.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Context
tdc thread viewrejected SDK-generated inbox thread links such ashttps://comms.todoist.com/{workspace}/inbox/t/{thread}/.What was changed
inbox/tandsaved/tthread URL routes inparseCommsUrl.