Conversation
|
@Koc thanks, this looks very promising. I didn't even know about |
|
@mejo- sure, give me few days and I will finalize current PR |
Signed-off-by: Kostiantyn Miakshyn <molodchick@gmail.com>
658883e to
9e8f94d
Compare
| * @throws \OCP\DB\Exception | ||
| */ | ||
| public function insertIgnoreConflict(Entity $entity): int { | ||
| if ($entity instanceof SnowflakeAwareEntity) { |
There was a problem hiding this comment.
Can you elaborate on why you introduced this trait instead of just using $this->db->insertIgnoreConflict() directly within the mapper functions? As far as I know, we don't use snowflake IDs yet in Collectives, and I'd prefer to not add code handling this specific case before we introduce snowflake IDs.
There was a problem hiding this comment.
$this->db->insertIgnoreConflict() works with plain tables/arrays of columns=>values. But I want to continue using entities like it was before. That's why I've introduced insertIgnoreConflict on a mapper level that accepts entity object and uses $this->db->insertIgnoreConflict() under the hood.
📝 Summary
This is alternative approach to fix #1886, #2405. Even after #2451 we observe tons of logs on PostgreSQL side related to duplication. In this PR this logs are gone
🏁 Checklist
npm run lint/npm run stylelint/composer run cs:check)🤖 AI (if applicable)