Skip to content

fix(habit): add API fallback for archived habit lookup by name#19

Merged
JeelyWu merged 1 commit into
masterfrom
fix/habit
May 15, 2026
Merged

fix(habit): add API fallback for archived habit lookup by name#19
JeelyWu merged 1 commit into
masterfrom
fix/habit

Conversation

@JeelyWu
Copy link
Copy Markdown
Owner

@JeelyWu JeelyWu commented May 15, 2026

Summary

  • Fix habit archive failing to find archived habits by name because ListHabits only returns active habits.
  • When ResolveHabit fails, fall back to a direct GetHabit API call, which works regardless of status.
  • Add tests for ID lookup and the archived-habit fallback path.

Test plan

  • go test ./... passes
  • TestHabitGetFallbackToAPI covers the new fallback behavior

🤖 Generated with Claude Code

ListHabits only returns active habits, so resolving by name fails for
archived habits. When ResolveHabit returns not-found, fall back to a
direct GetHabit API call, which works regardless of status.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@JeelyWu JeelyWu merged commit 10a3377 into master May 15, 2026
1 check passed
@JeelyWu JeelyWu deleted the fix/habit branch May 16, 2026 14:24
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.

1 participant