diff --git a/src/services/note/create.ts b/src/services/note/create.ts index 071aad0149c1..e911a3e15acf 100644 --- a/src/services/note/create.ts +++ b/src/services/note/create.ts @@ -517,9 +517,17 @@ async function insertNote(user: IUser, data: Option, tags: string[], emojis: str } catch (e) { // duplicate key error if (e.code === 11000) { - return null; + if (insert.uri != null) { + const n = await Note.findOne({ uri: insert.uri }); + if (n) { + console.warn(`duplicated insert: ${n.uri}`); + return n; + } + } } + console.error(e); + throw 'something happened'; } }