Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix crash when checking the sync file status #11982

Merged
merged 1 commit into from
Nov 18, 2024

Conversation

erikjv
Copy link
Collaborator

@erikjv erikjv commented Nov 14, 2024

Sometimes a Folder is created for a local path that we cannot sync (e.g. it's not writable). This folder will not have a sync engine. If the engine of this Folder is accessed, this will lead to a crash.

The fix is to check for the existance of a sync engine in the Folder::canSync() method.

Fixes: #11981

Sometimes a `Folder` is created for a local path that we cannot sync
(e.g. it's not writable). This folder will not have a sync engine. If
the engine of this `Folder` is accessed, this will lead to a crash.

The fix is to check for the existance of a sync engine in the
`Folder::canSync()` method.

Fixes: #11981
@erikjv erikjv self-assigned this Nov 14, 2024
@erikjv
Copy link
Collaborator Author

erikjv commented Nov 14, 2024

IMO a Folder object without a sync engine is incomplete. And it cannot get a sync engine later on. So I think this folder object should never have been created. But refactoring that is for another PR.

@DeepDiver1975 DeepDiver1975 merged commit b65361a into master Nov 18, 2024
6 checks passed
@DeepDiver1975 DeepDiver1975 deleted the work/fix-sync-file-status-crash branch November 18, 2024 10:26
DeepDiver1975 pushed a commit that referenced this pull request Nov 29, 2024
Sometimes a `Folder` is created for a local path that we cannot sync
(e.g. it's not writable). This folder will not have a sync engine. If
the engine of this `Folder` is accessed, this will lead to a crash.

The fix is to check for the existance of a sync engine in the
`Folder::canSync()` method.

Fixes: #11981
DeepDiver1975 added a commit that referenced this pull request Nov 29, 2024
Sometimes a `Folder` is created for a local path that we cannot sync
(e.g. it's not writable). This folder will not have a sync engine. If
the engine of this `Folder` is accessed, this will lead to a crash.

The fix is to check for the existance of a sync engine in the
`Folder::canSync()` method.

Fixes: #11981

Co-authored-by: Erik Verbruggen <[email protected]>
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.

OCC::SyncEngine::syncFileStatusTracker
2 participants