fix: NAS WebDAV sync — persist config, push notes without notebook, M…#29
Merged
fix: NAS WebDAV sync — persist config, push notes without notebook, M…#29
Conversation
…KCOL 405 Three bugs prevented notes from syncing to the NAS: 1. MKCOL returned 405 (already exists) on second sync → treated as failure. Now 405 is accepted as success (WebDAV standard for existing resource). 2. Notes not assigned to a notebook were silently skipped during push. They now sync into a 'sans-carnet' folder on the remote server. 3. Sync credentials were in-memory only — lost on every backend restart. Now persisted to data_dir/sync_config.json and reloaded on startup. Also added bilingual (EN/FR) module docstrings per project convention. https://claude.ai/code/session_01DrMeeXsyuHucgvtcwtJoLN
Security (sync_config.json): - Password is no longer persisted to disk (only kept in memory) - Only non-sensitive fields are written: server_url, username, conflict_strategy - File permissions set to 0o600 (owner read/write only) - Behavior clearly documented in docstrings (EN + FR) Exception handling: - 'except Exception' narrowed to (OSError, json.JSONDecodeError, ValueError) when loading sync config from disk - Write errors narrowed to OSError DRY — MKCOL status: - Extracted WebDAVClient._is_mkcol_success(status_code) static method - Both create_notebook_dir() and create_note_dir() now use the helper - RFC 4918 behaviour documented in the method docstring (EN + FR) Constant: - Hardcoded "sans-carnet" replaced by module-level DEFAULT_NOTEBOOK_SLUG = "uncategorized" https://claude.ai/code/session_01DrMeeXsyuHucgvtcwtJoLN
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.