Skip to content

fix: return SyncLog error entry instead of False when local path is not allowed#4694

Open
geoClink wants to merge 1 commit into
TandoorRecipes:developfrom
geoClink:fix/sync-local-path-not-allowed-error
Open

fix: return SyncLog error entry instead of False when local path is not allowed#4694
geoClink wants to merge 1 commit into
TandoorRecipes:developfrom
geoClink:fix/sync-local-path-not-allowed-error

Conversation

@geoClink

@geoClink geoClink commented Jun 6, 2026

Copy link
Copy Markdown

Bug

When syncing a local storage folder with a path that is not in LOCAL_STORAGE_PATHS, the import_all method in local.py returns
False. The query_synced_folder endpoint then passes this boolean to SyncLogSerializer, which crashes with AttributeError: 'bool' object has no attribute 'status', resulting in a 500 error.

Root Cause

Local.import_all() returns False on a path validation failure instead of a SyncLog object. The serializer expects a SyncLog

Fix

Instead of returning False, create and save a SyncLog entry with status='ERROR' and return it. This is consistent with the success
path already in the same method and gives the serializer a valid object to work with.

Testing

Unable to test locally, but the fix follows the exact same pattern as the success case already in local.py.

- Added error logging to the Local provider when a disallowed path is accessed
- Created a new SyncLog entry with status 'ERROR' and a message indicating the path is not allowed
- Saved the log entry and returned it
@geoClink

geoClink commented Jun 6, 2026

Copy link
Copy Markdown
Author

This is ready for review. Instead of returning False on a disallowed path, the method now creates and returns a SyncLog error entry, consistent with the success path in the same method.

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