Skip to content

Fix: filter empty strings in sync auth status after disconnect - #198

Merged
tylergraydev merged 1 commit into
tylergraydev:mainfrom
prefrontalsys:fix/disconnect-clears-state
Apr 14, 2026
Merged

tylergraydev merged 1 commit into
tylergraydev:mainfrom
prefrontalsys:fix/disconnect-clears-state

Conversation

@prefrontalsys

Copy link
Copy Markdown
Contributor

Summary

  • disconnect_cloud_sync sets sync_gist_id to "" (no delete_setting method exists)
  • get_sync_auth_status checked gist_id.is_some() without filtering empty strings
  • Some("") passes the is_some() check, so is_authenticated stayed true after disconnect
  • Adds .filter(|s| !s.is_empty()) to all get_setting calls, matching the pattern already used in get_sync_status

Test plan

  • Connect cloud sync, then disconnect — verify auth status shows as disconnected
  • Reconnect after disconnect — verify it works cleanly

Relates to #195

🤖 Generated with Claude Code

disconnect_cloud_sync sets sync_gist_id to "" rather than deleting
it. Since get_setting returns Some("") for empty values, the
is_authenticated check (token.is_some() && gist_id.is_some())
incorrectly returns true after disconnect.

Add .filter(|s| !s.is_empty()) to all get_setting calls in
get_sync_auth_status, matching the pattern already used in
get_sync_status.

Relates to tylergraydev#195

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

@tylergraydev tylergraydev left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Clean fix. The .filter(|s| !s.is_empty()) pattern matches the existing usage at lines 335-336 in get_sync_status. Root cause is well-explained in the PR description.

LGTM, merging.

@tylergraydev
tylergraydev merged commit 3af9191 into tylergraydev:main Apr 14, 2026
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.

2 participants