Skip to content

fix(Twitter): guard None post, fix cache miss, fix char limit#236

Open
tatenda-source wants to merge 2 commits intoFujiwaraChoki:mainfrom
tatenda-source:fix/twitter-none-post-cache-charlimit
Open

fix(Twitter): guard None post, fix cache miss, fix char limit#236
tatenda-source wants to merge 2 commits intoFujiwaraChoki:mainfrom
tatenda-source:fix/twitter-none-post-cache-charlimit

Conversation

@tatenda-source
Copy link
Copy Markdown

Summary

  • Guard against None post content from failed generation
  • Fix add_post() to auto-create account in cache if missing
  • Fix character limit to match Twitter actual 280
  • Track text_sent success reliably

Closes #226

Test plan

  • Post a tweet and verify it appears in cache
  • Test with a new account not yet in cache
  • Verify long posts are truncated at 280 chars

🤖 Generated with Claude Code

…imit

Closes FujiwaraChoki#226

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 442f89cb3e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/classes/Twitter.py Outdated
Comment on lines 188 to 189
with open(get_twitter_cache_path(), "r") as file:
previous_json = json.loads(file.read())
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Create cache file before reading in add_post

add_post now opens twitter.json directly, but this method no longer calls get_posts() (which used to create the file when missing). If Twitter.post() is invoked in a context where the cache file has not been initialized yet (e.g., direct class usage or after cache cleanup), this raises FileNotFoundError and aborts posting before the cache can be updated.

Useful? React with 👍 / 👎.

Ensures add_post() creates the twitter.json cache file when it
doesn't exist, preventing FileNotFoundError on first use.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(Twitter): None post content, lost posts, and wrong character limit

1 participant