Repository navigation
fix: pagination cap (#50), --time (#35), completions (#36), actionable auth failures (#72/#28/#66) - #104
Open
axsddlr wants to merge 6 commits into
Open
fix: pagination cap (#50), --time (#35), completions (#36), actionable auth failures (#72/#28/#66)#104axsddlr wants to merge 6 commits into
axsddlr wants to merge 6 commits into
Conversation
…ackwener#50) `_fetch_user_list` clamped the requested count to `self._max_count`, which comes from `rateLimit.maxCount` (default 200) and was additionally bounded by a hard `_ABSOLUTE_MAX_COUNT = 500`. The cursor pagination underneath was correct, so an account with more followers than that was silently truncated no matter what `--max` said. Treat `rateLimit.maxCount` as a default for calls that do not specify a count, not as a ceiling on an explicit request, and clamp only at the safety ceiling. Raise that ceiling from 500 to 10000 — it exists to stop a typo or a runaway config, not to cap legitimate requests — and log a warning when it engages so the truncation is visible instead of silent. Tweets are left clamping to the configured `maxCount`; this issue is about user lists, and changing timeline behaviour is out of scope here. Tests cover 600 users via an explicit --max (the old 500 ceiling), 300 users against a 200 config default, the safety ceiling, and non-positive counts. A negative control run against the previous client.py fails 4 of the 5.
Human-readable output hard-coded relative timestamps ("14d ago"), which is
awkward when you need to know *when* something was posted.
Add a root `--time {relative,absolute,iso}` option, plus an optional
`display.time` config key for people who want it always on:
* relative (default) — unchanged behaviour
* absolute — local wall-clock, "2026-03-14 21:08"
* iso — unambiguous, "2026-03-14T21:08:00+00:00"
Rendering goes through a single `_render_time` helper in formatter.py, so both
the feed table and the detail panel follow the setting. The detail panel
previously printed "2026-03-14 21:08 (3d ago)"; under absolute/iso it now prints
one stamp instead of the same value twice.
Structured output (--json/--yaml) is untouched: it already carries both
createdAt and createdAtLocal.
…r#36) The CLI has ~30 subcommands with their own options, but shipped no completion, so everything had to be typed from memory. Add `twitter completion {bash,zsh,fish}`, which prints a completion script. This uses Click's built-in completion support, so it adds **no dependency** — the issue suggested shtab, but Click 8 already generates correct scripts for every shell and drives completion from the CLI's own command tree, meaning it cannot drift out of sync with the code. Usage: twitter completion bash >> ~/.bashrc twitter completion zsh > "${fpath[1]}/_twitter" twitter completion fish > ~/.config/fish/completions/twitter.fish Tests assert each shell emits a real script (defines its completion function / compdef), that an unsupported shell is rejected, and that a missing argument errors rather than printing something useless.
Two advisory fixes for issues that cannot be resolved by code alone. jackwener#28 / jackwener#66 / jackwener#46 — Windows cookie extraction `Unable to get key for cookie decryption` on Windows is almost always Chrome/Edge 127+ **App-Bound Encryption**, which browser_cookie3 cannot unwrap. The old hint listed DPAPI causes and suggested running as admin, which sends people down the wrong path. Detect the decrypt diagnostic and give the real options: use Firefox (still readable), or export auth_token/ct0 from DevTools or a cookie extension and set them as env vars. The existing DPAPI/VSS-copy advice is retained as a secondary cause, since it is still valid when the failure is not ABC. Not a full fix: decrypting ABC would require a Windows-only key extractor. That is out of scope here; the issue becomes actionable instead of cryptic. jackwener#72 — account flagged as a bot X treats an unsigned write as automation. Writes now log a prominent warning when x-client-transaction-id is unavailable. Deliberately a warning, not a refusal: the change may still land, and hard-failing writes (as proposed in upstream jackwener#101) turns a transient bootstrap failure into a broken command. Reads stay silent — they usually just 404, so a warning there is noise. Tests cover both branches, including that a signed write and an unsigned read do not warn, and that the write still returns headers rather than raising.
Adds the two new user-facing commands to the usage block, per the repo rule in AGENTS.md that behaviour changes update the README in the same change.
These assertions branch on sys.platform, so they only held when the suite ran on Windows; Linux CI failed. Pin sys.platform to win32 and clear the SSH vars, matching how the existing keychain tests do it.
axsddlr
force-pushed
the
fix/open-issues
branch
from
October 31, 2026 10:37
81cdb75 to
58872f1
Compare
This branch has not been deployed
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.
Four focused changes covering #50, #35, #36, and the account-safety / Windows-cookie issues (#72, #28, #66, #46). Each commit is independent; scope is 10 files, +649/−42.
#50 — honour an explicit
--maxfor followers/following_fetch_user_listclamped the requested count toself._max_count, which comes fromrateLimit.maxCount(default 200) and was additionally bounded by a hard_ABSOLUTE_MAX_COUNT = 500. The cursor pagination underneath was correct, so an account with more followers than that was silently truncated no matter what--maxsaid.rateLimit.maxCountis now a default for calls that don't specify a count, not a ceiling on an explicit request. The safety ceiling rises 500 → 10000 and logs a warning when it engages, so truncation is visible instead of silent.Tweets keep clamping to the configured
maxCount— this issue is about user lists, and changing timeline behaviour is out of scope.Negative control against the previous
client.py: 4 of 5 fail.#35 —
--timeto choose timestamp styleOutput hard-coded relative times ("14d ago"). Adds a root
--time {relative,absolute,iso}option plus an optionaldisplay.timeconfig key:relative(default) — unchangedabsolute— local wall-clock,2026-03-14 21:08iso—2026-03-14T21:08:00+00:00Both the feed table and the detail panel follow it. The detail panel used to print
2026-03-14 21:08 (3d ago); under absolute/iso it now prints one stamp instead of repeating the same value.--json/--yamlare untouched (they already carrycreatedAtandcreatedAtLocal).#36 — shell completions
twitter completion {bash,zsh,fish}prints a completion script.This uses Click's built-in support, so no dependency is added — the issue suggested
shtab, but Click 8 already generates correct scripts and drives completion from the CLI's own command tree, so it cannot drift from the code.Tests assert each shell emits a real script (its completion function /
#compdef), and that an unsupported shell or a missing argument errors.#72 / #28 / #66 / #46 — make the failure mode actionable
Neither can be fully fixed by code here, so these make the cause and the workaround explicit instead of leaving a silent 404 or a misleading hint.
#72 (account flagged as a bot): X treats an unsigned write as automation. Writes now log a prominent warning when
x-client-transaction-idis unavailable. Deliberately a warning, not a refusal — the change may still land, and hard-failing writes (as proposed in #101) turns a transient bootstrap failure into a broken command. Reads stay silent, since they usually just 404.#28 / #66 (Windows
Unable to get key for cookie decryption): this is almost always Chrome/Edge 127+ App-Bound Encryption, whichbrowser_cookie3cannot unwrap. The old hint blamed DPAPI permissions and suggested running as admin — the wrong path. It now names App-Bound Encryption, states it is not a permissions problem, and gives the two workarounds that work: use Firefox (TWITTER_BROWSER=firefox), or exportauth_token/ct0from DevTools / a cookie extension and set the env vars. The DPAPI / "close Chrome" / VSS-shadowcopy advice is kept as a secondary cause.A full fix for #28/#66 needs a Windows-only ABC key extractor; that is out of scope here.
Verification
The Windows-branch tests pin
sys.platform, so they assert Windows behaviour on any host — Linux CI caught the first revision not doing that, and the fix is included.On Windows this branch still shows the repo's 3 pre-existing
test_authfailures (theHOME/USERPROFILEissue); that is fixed separately in #102 and is unrelated to these changes.