refactor: drop deprecated Twist-era date-range params#7
Merged
Conversation
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.
doistbot
reviewed
May 21, 2026
Member
doistbot
left a comment
There was a problem hiding this comment.
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.
scottlovegrove
approved these changes
May 21, 2026
- 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`.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
Follow-up to Scott's note on #4. Cross-checked against
twist-new-backend—threads.py,comments.py,inbox.pyonly readnewer_than_ts/older_than_tson the wire, so the legacy aliaseswere SDK-side ergonomics from the Twist-SDK era.
What was changed
GetCommentsArgs: dropfromGetThreadsArgs: dropnewer_than_ts,older_than_tsGetInboxArgs: dropsince,untilArchiveAllArgs: dropsince,untilCallers must use
newerThan/olderThan(Date). Wire format unchanged.Refs