-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
admin/drive/cleanup could delete imported custom emoji #8222
Comments
There is also the option of not using Drive to manage file data used internally by the system, such as emoji (e.g., create a more general file table and have DriveFile refer to it). |
That sounds much more complicated than any of the suggestions I made. Unless you have a different use for this I would absolutely not recommend it. And even then I think option 2 would be more sensible for what you say.
|
I think option 1 is too complicated. If option 2 is implemented, we should also add a However it would also implicate that It would also be possible to combine options 2 and 3. However, in full view with the drive quota problem in mind I think option 3 is the best. |
If option 3 is implemented, I'm not sure if this constraint should be changed as well: TABLE "drive_file" CONSTRAINT "FK_860fa6f6c7df5bb887249fba22e" FOREIGN KEY ("userId") REFERENCES "user"(id) ON DELETE SET NULL Setting to null on delete does not make sense because it would move the file to the drive of the system. Cascading the delete is also not a good idea because the file on disk has to be deleted outside of the database as well. Maybe it should be changed to |
This API endpoint is not working correctly and can cause unintended data loss: It may remove emojis that have been imported from other instances. See also misskey-dev#8222
💡 Summary
/api/admin/drive/cleanup
deletes all drive files whereuserId = NULL
:misskey/packages/backend/src/server/api/endpoints/admin/drive/cleanup.ts
Lines 15 to 17 in 149edae
This could accidentally delete imported emoji since they are created with
userId
set toNULL
:misskey/packages/backend/src/server/api/endpoints/admin/emoji/copy.ts
Line 57 in 149edae
🔧❓ Possible Solutions
/api/admin/drive/cleanup
.This would probably be complicated, but could be done with the TypeORM equivalent of
@instance.actor
the owner of imported emojis.misskey/packages/backend/src/queue/processors/db/delete-account.ts
Line 48 in c69b72e
Additional Info
related to #7304
The text was updated successfully, but these errors were encountered: