Skip to content

fix: align config filename between read and write paths (#161)#168

Open
patchwright wants to merge 1 commit into
bergercookie:masterfrom
patchwright:fix/config-fname-mismatch-161
Open

fix: align config filename between read and write paths (#161)#168
patchwright wants to merge 1 commit into
bergercookie:masterfrom
patchwright:fix/config-fname-mismatch-161

Conversation

@patchwright

Copy link
Copy Markdown

Problem

Fixes #161. Combinations are written to tw_gtasks_configs.yaml (by tw_gtasks_sync.py) but read from tw__google_tasks__configs.yaml (by determine_app_config_fname) — the filenames never matched, so saved combinations were unreadable.

Root cause

determine_app_config_fname("TW", "Google Tasks") generated tw__google_tasks__configs.yaml (double-underscore + full name), while every sync script writes to tw_<short>_configs.yaml (single-underscore + abbreviated name, e.g. tw_gtasks_configs). The two naming conventions were never aligned.

Fix

Add a _SERVICE_ABBREVIATIONS mapping (Google Tasks -> gtasks, Google Calendar -> gcal, Google Keep -> gkeep) so determine_app_config_fname produces the same filename the sync scripts use. Verified for all 6 sync pairs (gtasks, gcal, gkeep, asana, notion, caldav).

How to test

from syncall.app_utils import determine_app_config_fname
assert determine_app_config_fname("TW", "Google Tasks") == "tw_gtasks_configs.yaml"

Note: full test suite requires optional deps (xattr) that are not available in my environment. Function output verified via doctests for all 6 pairs.

Backward compatibility

The read-path file (tw__google_tasks__configs.yaml) was always empty (per #161 — the write path never matched). All user data lives in the write-path files (tw_gtasks_configs.yaml), which are now correctly found by the read path. No migration needed.


Assisted-by: Claude (code generation, reviewed and tested locally)

The read path (determine_app_config_fname) generated filenames like
'tw__google_tasks__configs.yaml' while the write path (tw_gtasks_sync.py)
stored combinations in 'tw_gtasks_configs.yaml' — different name (full vs
abbreviated) AND joiner (double vs single underscore). Combinations were
written but could not be read back (bergercookie#161).

Add a service-name-to-abbreviation mapping so determine_app_config_fname
produces the same filename the sync scripts use. Fixes bergercookie#161.

Note: full test suite could not run locally (missing xattr + __version__
deps); function output verified via doctests for all 6 sync pairs.

Assisted-by: Claude (Anthropic).
Co-Authored-By: claude-flow <ruv@ruv.net>
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.

[BUG] combinations are broken

1 participant