Skip to content

Conversation

@jzunigax2
Copy link
Contributor

@jzunigax2 jzunigax2 commented Jan 6, 2026

Whenever a "device" is deleted on drive web it just deletes the folder, this caused orphaned device records pointing to a deleted root folder. Whenever the linux client attempted to recreate the device it got a conflict exception as the device already exists.

This PR allows a device to be deleted when its matching backup root folder is deleted

@jzunigax2 jzunigax2 requested a review from sg-gs January 6, 2026 19:20
@jzunigax2 jzunigax2 self-assigned this Jan 6, 2026
@jzunigax2 jzunigax2 added the bug Something isn't working label Jan 6, 2026
@sg-gs
Copy link
Member

sg-gs commented Jan 7, 2026

Shouldn't we remove the device directly then? @jzunigax2

deviceId: number,
folderUuid: string,
) {
const [_, affectedDevice] = await this.deviceModel.update(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid using business logic wording on the repository layer. It is an updated device, not an affected one

@jzunigax2 jzunigax2 force-pushed the fix/unable-to-backup-after-device-deletion branch from ed2137c to 4197cd3 Compare January 8, 2026 17:32
@sonarqubecloud
Copy link

sonarqubecloud bot commented Jan 8, 2026

@jzunigax2 jzunigax2 requested a review from sg-gs January 8, 2026 19:58
@jzunigax2
Copy link
Contributor Author

Shouldn't we remove the device directly then? @jzunigax2

changed my approach a bit as I was under the impression only mac was not using the newer v2 flow so I didn't want to mix up the newer logic with the older one.

But now that I know only Linux uses it I changed it so the device is deleted and created the cleanup script in another PR

@jzunigax2 jzunigax2 changed the title [PB-5658]: fix(backups): allow folder creation on orphaned devices [PB-5658]: fix(backups): allow device deletion on backup folder deletion Jan 9, 2026
@jzunigax2 jzunigax2 merged commit 2c007f6 into master Jan 9, 2026
13 checks passed
@jzunigax2 jzunigax2 deleted the fix/unable-to-backup-after-device-deletion branch January 9, 2026 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working ready-for-preview

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants