Skip to content

fix: NAS WebDAV sync — persist config, push notes without notebook, M…#29

Merged
TheZupZup merged 2 commits intomainfrom
claude/fix-gray-screen-I13Ww
Apr 12, 2026
Merged

fix: NAS WebDAV sync — persist config, push notes without notebook, M…#29
TheZupZup merged 2 commits intomainfrom
claude/fix-gray-screen-I13Ww

Conversation

@TheZupZup
Copy link
Copy Markdown
Owner

No description provided.

claude added 2 commits April 12, 2026 16:51
…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
@TheZupZup TheZupZup merged commit a051943 into main Apr 12, 2026
1 check passed
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