social icon indicating copy to clipboard operation
social copied to clipboard

Integrity constraint violation: 1062 Duplicate entry, if I press twice to the same post

Open CoreTechnologyAG opened this issue 5 years ago • 0 comments

Describe the bug I can not like a post twice, it gets an error "Duplicate entry" in the log

To Reproduce

  1. Go to 'Social/Home'
  2. Click on 'Star' by a post
  3. Click 'Liked' in the left navigation
  4. Click on 'Star' by the post from point 2. Kind of disable
  5. Switch back to 'home'
  6. Click on the same post on the star and it shows an error 'Failed to like a post'

Expected behavior allow the like

Social app version: 0.4.2

Nextcloud log (data/nextcloud.log)

{"reqId":"9NMADlfcTolSGL3Xf3Co","level":2,"time":"2020-12-09T13:38:08+00:00","remoteAddr":"10.0.0.9","user":"admin2test","app":"no app in context","method":"POST","url":"/apps/social/api/v1/post/like?postId=https://testfpm.nextcloud.core.ch/apps/social/@admin2test/16075203301119212426","message":"500 - {\"status\":-1,\"exception\":\"Doctrine\\\\DBAL\\\\Exception\\\\UniqueConstraintViolationException\",\"message\":\"An exception occurred while executing 'INSERT INTO `oc_social_3_action` (`id`, `actor_id`, `actor_id_prim`, `type`, `object_id`, `object_id_prim`, `creation`, `id_prim`) VALUES(?, ?, ?, ?, ?, ?, ?, ?)' with params [\\\"https:\\\\\\/\\\\\\/testfpm.nextcloud.core.ch\\\\\\/apps\\\\\\/social\\\\\\/@admin2test#like\\\\\\/c92ced55\\\", \\\"https:\\\\\\/\\\\\\/testfpm.nextcloud.core.ch\\\\\\/apps\\\\\\/social\\\\\\/@admin2test\\\", \\\"0db1a5f0447283b2e5dab2c5d3c9e9a9217ef4e8abc007b38c7eb8aff906bd84b5660d6feb6108cbfe94676c8179cb6426b239500af3423fcc4e10bd2ef487b5\\\", \\\"Like\\\", \\\"https:\\\\\\/\\\\\\/testfpm.nextcloud.core.ch\\\\\\/apps\\\\\\/social\\\\\\/@admin2test\\\\\\/16075203301119212426\\\", \\\"9364121e21957fa022a37967e79214b294c89b69f036dd00a141b5e62e59c208812973c240c19587cb15868ece4f9ab86ddcd1979b28bbe04bdf48c9fe7b094c\\\", \\\"2020-12-09 13:38:08\\\", \\\"6f68e84d638905b7b007c3903ab11437d1e0083afa7906371363dbfd8ee38b15646f0a1adde45f7c8f86b7f4baa64b829d41188364f89c67a65681c405bb081c\\\"]:\\n\\nSQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '0db1a5f0447283b2e5dab2c5d3c9e9a9217ef4e8abc007b38c7eb8aff906b...' for key 'aot'\"}","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:83.0) Gecko/20100101 Firefox/83.0","version":"20.0.2.2","id":"5fd0d3557578d"}```

CoreTechnologyAG avatar Dec 09 '20 13:12 CoreTechnologyAG