linkwarden / browser-extension

Browser extension for Linkwarden
GNU Affero General Public License v3.0
146 stars 12 forks source link

Adding a new tag through extension is broken #64

Closed mh4ckt3mh4ckt1c4s closed 2 months ago

mh4ckt3mh4ckt1c4s commented 4 months ago

It seems that the latest version of Linkwarden is crashing (internal server error) when trying to add a link with a new tag (that was not existing before).

Reproduce :

Try to add a new link with Linkwarden browser extension, and adding a tag that was not existing before

Versions :

Linkwarden v1.25.0 selfhosted Linkwarden firefox extension v1.2.5 Firefox 123.0.1

crkos commented 4 months ago

Hello, I saw that linkwarden just got updated, so that might be it, I might work on that this weekend because its very important its at least working with the new release

mh4ckt3mh4ckt1c4s commented 4 months ago

After a few more tests, it seems that the problem is also present with already existing tags, but only if the link is saved in the "Unorganized" collection. Adding a link without tags in the unorganized collection works fine, and adding tags and putting the link into an existing collection works fine too. Here are the logs of the related error of linkwarden :

[0] PrismaClientValidationError: Argument ownerId for data.tags.connectOrCreate.0.where.name_ownerId.ownerId is missing.
[0] Argument data.tags.connectOrCreate.0.create.owner.connect of type UserWhereUniqueInput needs at least one argument.
[0]
[0]     at Ui.validate (/data/node_modules/@prisma/client/runtime/library.js:148:73)
[0]     at gn.createMessage (/data/node_modules/@prisma/client/runtime/library.js:164:1298)
[0]     at /data/node_modules/@prisma/client/runtime/library.js:177:11600
[0]     at Object.runInChildSpan (/data/node_modules/@prisma/client/runtime/library.js:174:1394)
[0]     at t._executeRequest (/data/node_modules/@prisma/client/runtime/library.js:177:11577)
[0]     at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
[0]     at async postLink (/data/.next/server/pages/api/v1/links.js:571:21)
[0]     at async links (/data/.next/server/pages/api/v1/links.js:693:25) {
[0]   clientVersion: '4.16.2'
[0] }

Feel free to ask if you need more details.

crkos commented 4 months ago

Thanks for the info!

crkos commented 4 months ago

Seems related that ownerId is not present when i do the request

crkos commented 2 months ago

Fixed by @daniel31x13 on linkwarden