summaryrefslogtreecommitdiff
path: root/packages/backend/src/core
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2023-10-19 11:17:59 +0900
committersyuilo <Syuilotan@yahoo.co.jp>2023-10-19 11:17:59 +0900
commitf9549e1f1b924e75270bf5b75aee1a399fc9a2a0 (patch)
tree0080a8699213b8abea4fee3da363ddb333159d7b /packages/backend/src/core
parentperf(backend): ノートのリアクション情報をキャッシュする... (diff)
downloadmisskey-f9549e1f1b924e75270bf5b75aee1a399fc9a2a0.tar.gz
misskey-f9549e1f1b924e75270bf5b75aee1a399fc9a2a0.tar.bz2
misskey-f9549e1f1b924e75270bf5b75aee1a399fc9a2a0.zip
fix(backend): fix of 1671575d5d
Diffstat (limited to 'packages/backend/src/core')
-rw-r--r--packages/backend/src/core/ReactionService.ts4
-rw-r--r--packages/backend/src/core/entities/NoteEntityService.ts6
2 files changed, 5 insertions, 5 deletions
diff --git a/packages/backend/src/core/ReactionService.ts b/packages/backend/src/core/ReactionService.ts
index edf433025d..f3f2b04dd6 100644
--- a/packages/backend/src/core/ReactionService.ts
+++ b/packages/backend/src/core/ReactionService.ts
@@ -188,7 +188,7 @@ export class ReactionService {
.set({
reactions: () => sql,
...(note.reactionAndUserPairCache.length < 10 ? {
- reactionAndUserPairCache: () => `array_append("reactionAndUserPairCache", '${user.id}:${reaction}')`,
+ reactionAndUserPairCache: () => `array_append("reactionAndUserPairCache", '${user.id}/${reaction}')`,
} : {}),
})
.where('id = :id', { id: note.id })
@@ -296,7 +296,7 @@ export class ReactionService {
await this.notesRepository.createQueryBuilder().update()
.set({
reactions: () => sql,
- reactionAndUserPairCache: () => `array_remove("reactionAndUserPairCache", '${user.id}:${exist.reaction}')`,
+ reactionAndUserPairCache: () => `array_remove("reactionAndUserPairCache", '${user.id}/${exist.reaction}')`,
})
.where('id = :id', { id: note.id })
.execute();
diff --git a/packages/backend/src/core/entities/NoteEntityService.ts b/packages/backend/src/core/entities/NoteEntityService.ts
index b46b5528a5..c100b92ee7 100644
--- a/packages/backend/src/core/entities/NoteEntityService.ts
+++ b/packages/backend/src/core/entities/NoteEntityService.ts
@@ -187,7 +187,7 @@ export class NoteEntityService implements OnModuleInit {
if (note.reactionAndUserPairCache && reactionsCount <= note.reactionAndUserPairCache.length) {
const pair = note.reactionAndUserPairCache.find(p => p.startsWith(meId));
if (pair) {
- return this.reactionService.convertLegacyReaction(pair.split(':')[1]);
+ return this.reactionService.convertLegacyReaction(pair.split('/')[1]);
} else {
return undefined;
}
@@ -411,7 +411,7 @@ export class NoteEntityService implements OnModuleInit {
myReactionsMap.set(note.renote.id, null);
} else if (reactionsCount <= note.renote.reactionAndUserPairCache.length) {
const pair = note.renote.reactionAndUserPairCache.find(p => p.startsWith(meId));
- myReactionsMap.set(note.renote.id, pair ? pair.split(':')[1] : null);
+ myReactionsMap.set(note.renote.id, pair ? pair.split('/')[1] : null);
} else {
idsNeedFetchMyReaction.add(note.renote.id);
}
@@ -422,7 +422,7 @@ export class NoteEntityService implements OnModuleInit {
myReactionsMap.set(note.id, null);
} else if (reactionsCount <= note.reactionAndUserPairCache.length) {
const pair = note.reactionAndUserPairCache.find(p => p.startsWith(meId));
- myReactionsMap.set(note.id, pair ? pair.split(':')[1] : null);
+ myReactionsMap.set(note.id, pair ? pair.split('/')[1] : null);
} else {
idsNeedFetchMyReaction.add(note.id);
}