Skip to content

fix: handle string and empty repeatFrom values from API#29

Open
crisperit wants to merge 1 commit intodev-mirzabicer:mainfrom
crisperit:fix/7-repeat-from-string-parsing
Open

fix: handle string and empty repeatFrom values from API#29
crisperit wants to merge 1 commit intodev-mirzabicer:mainfrom
crisperit:fix/7-repeat-from-string-parsing

Conversation

@crisperit
Copy link
Copy Markdown

Summary

  • Added field validator to parse repeatFrom field correctly
  • Handles string values ("0", "1", "2"), null, and empty string ""
  • The TickTick API returns repeatFrom as a string, but the model expected int | None

Fixes #7

Test plan

  • Tested with ticktick_list_tasks - tasks with recurring schedules now parse correctly

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Jan 25, 2026

Important

Review skipped

Auto reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

The TickTick API returns repeatFrom as a string ("0", "1", "2"),
null, or empty string, but the model expected int | None.

Added field validator to parse all cases correctly.

Fixes dev-mirzabicer#7
@crisperit crisperit force-pushed the fix/7-repeat-from-string-parsing branch from e9d19e5 to ae857d5 Compare February 1, 2026 17:25
@hardane
Copy link
Copy Markdown

hardane commented Mar 13, 2026

Any plans to accep this PR? having the same issue as well over here

hardane pushed a commit to hardane/ticktick-sdk that referenced this pull request Mar 16, 2026
- auth.py & client.py: Mimic real browser headers (Chrome UA, Origin,
  Referer, full x-device) to avoid TickTick's AWS ELB rate limiting.
  Ref: dev-mirzabicer#34

- task.py: Add field_validator for repeat_from to handle string/empty
  values from TickTick API (e.g. "0", "1", "").
  Ref: dev-mirzabicer#29

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

ticktick_list_tasks seems not able to parse recurring task

2 participants