fix: return SyncLog error entry instead of False when local path is not allowed#4694
Open
geoClink wants to merge 1 commit into
Open
fix: return SyncLog error entry instead of False when local path is not allowed#4694geoClink wants to merge 1 commit into
geoClink wants to merge 1 commit into
Conversation
- 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
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. |
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.
Bug
When syncing a local storage folder with a path that is not in
LOCAL_STORAGE_PATHS, theimport_allmethod inlocal.pyreturnsFalse. Thequery_synced_folderendpoint then passes this boolean toSyncLogSerializer, which crashes withAttributeError: 'bool' object has no attribute 'status', resulting in a 500 error.Root Cause
Local.import_all()returnsFalseon a path validation failure instead of aSyncLogobject. The serializer expects aSyncLogFix
Instead of returning
False, create and save aSyncLogentry withstatus='ERROR'and return it. This is consistent with the successpath 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.