Skip to content

Conversation

@erikjv
Copy link
Contributor

@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
Contributor 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
4 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

3 participants