Skip to content

refactor: drop deprecated Twist-era date-range params#7

Merged
amix merged 2 commits into
mainfrom
amix/remove-deprecated-params-v2
May 21, 2026
Merged

refactor: drop deprecated Twist-era date-range params#7
amix merged 2 commits into
mainfrom
amix/remove-deprecated-params-v2

Conversation

@amix
Copy link
Copy Markdown
Member

@amix amix commented May 21, 2026

Context

Follow-up to Scott's note on #4. Cross-checked against
twist-new-backendthreads.py, comments.py, inbox.py only read
newer_than_ts / older_than_ts on the wire, so the legacy aliases
were SDK-side ergonomics from the Twist-SDK era.

What was changed

  • GetCommentsArgs: drop from
  • GetThreadsArgs: drop newer_than_ts, older_than_ts
  • GetInboxArgs: drop since, until
  • ArchiveAllArgs: drop since, until

Callers must use newerThan / olderThan (Date). Wire format unchanged.

Refs

The legacy `from` / `since` / `until` / `newer_than_ts` / `older_than_ts`
aliases were a Twist-SDK compatibility shim. The backend
(`twist/apps/api/threads.py`, `comments.py`, `inbox.py`) only consumes
`newer_than_ts` / `older_than_ts` on the wire — the SDK converts the
canonical `newerThan` / `olderThan` Date inputs into those over HTTP, so
the aliases were SDK-side only.

Removed in:
- `GetCommentsArgs` — `from`
- `GetThreadsArgs` — `newer_than_ts`, `older_than_ts`
- `GetInboxArgs` — `since`, `until`
- `ArchiveAllArgs` — `since`, `until`

Wire format is unchanged. Callers must use `newerThan` / `olderThan`.

Follow-up to Scott's review on #4.
@amix amix requested a review from scottlovegrove May 21, 2026 11:51
@amix amix added the 👀 Show PR PR must be reviewed before or after merging label May 21, 2026
@amix amix marked this pull request as ready for review May 21, 2026 11:51
Copy link
Copy Markdown
Member

@doistbot doistbot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR cleans up the codebase by removing deprecated Twist-era date-range parameters across several endpoints in favor of a unified newerThan and olderThan interface. This is a great step toward streamlining the SDK's ergonomics and ensuring consistent argument naming. A few areas for refinement were noted, specifically around ensuring legacy parameters are completely stripped at runtime rather than accidentally forwarded, as well as adding focused client tests across the affected endpoints to verify the correct wire serialization of the remaining date arguments.

Share FeedbackReview Logs

Comment thread src/clients/threads-client.ts Outdated
Comment thread src/clients/threads-client.ts Outdated
Comment thread src/clients/inbox-client.ts
Comment thread src/clients/inbox-client.ts
- Build `getThreads` params from an explicit allowlist so unknown keys
  (e.g. legacy `newer_than_ts` passed from JS) can't slip through.
- Add focused wire-serialization tests for `threads.getThreads`,
  `inbox.getInbox`, and `inbox.archiveAll`.
@amix amix merged commit 378c074 into main May 21, 2026
4 checks passed
@amix amix deleted the amix/remove-deprecated-params-v2 branch May 21, 2026 12:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

👀 Show PR PR must be reviewed before or after merging

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants