Skip to content

Commit 2867c21

Browse files
committed
fix(cache-dexie): fix primary key of eventTags store
Previously, tagValue alone was used as primary key for eventTags store. Since multiple events can share the same tag, only the last event with a given tag was stored. Use composite key [tagValue+eventId] to allow multiple events per tag.
1 parent 26abea2 commit 2867c21

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cache-dexie/src/db.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,10 @@ export class Database extends Dexie {
7878

7979
constructor(name: string) {
8080
super(name);
81-
this.version(18).stores({
81+
this.version(19).stores({
8282
profiles: "&pubkey",
8383
events: "&id, kind",
84-
eventTags: "&tagValue",
84+
eventTags: "[tagValue+eventId], tagValue",
8585
nip05: "&nip05",
8686
lnurl: "&pubkey",
8787
relayStatus: "&url",

0 commit comments

Comments
 (0)