diff --git a/.drone.yml b/.drone.yml index 12edc40a..b4a06493 100644 --- a/.drone.yml +++ b/.drone.yml @@ -98,6 +98,45 @@ steps: - 'git commit -a -m "chore: Update translations"' - git push -u origin main volumes: +- name: cache + claim: + name: docker-cache +--- +kind: pipeline +type: kubernetes +name: docker-release +concurrency: + limit: 1 +trigger: + event: + - tag +metadata: + namespace: git +steps: + - name: Build site + image: node:current-bullseye + volumes: + - name: cache + path: /cache + environment: + YARN_CACHE_FOLDER: /cache/.yarn-docker-release + commands: + - yarn install + - yarn build + - name: build docker image + image: r.j3ss.co/img + privileged: true + volumes: + - name: cache + path: /cache + environment: + TOKEN: + from_secret: docker_hub + commands: + - img login -u voidic -p $TOKEN + - img build -t voidic/snort:$DRONE_TAG --platform linux/amd64,linux/arm64 -f Dockerfile.prebuilt . + - img push voidic/snort:$DRONE_TAG +volumes: - name: cache claim: name: docker-cache \ No newline at end of file diff --git a/packages/system/src/note-collection.ts b/packages/system/src/note-collection.ts index 49f8786f..238f69ed 100644 --- a/packages/system/src/note-collection.ts +++ b/packages/system/src/note-collection.ts @@ -245,22 +245,24 @@ export class ReplaceableNoteStore extends HookedNoteStore e.pubkey); + super((e) => { + const legacyReplaceable = [0, 3, 41] + if (e.kind >= 30_000 && e.kind < 40_000) { + return `${e.kind}:${e.pubkey}:${findTag(e, "d")}`; // Parameterized replaceable + } else if (e.kind >= 10_000 && e.kind < 20_000) { + return `${e.kind}:${e.pubkey}`; // Replaceable event + } else if (legacyReplaceable.includes(e.kind)) { + return `${e.kind}:${e.pubkey}`; // Replaceable event + } else { + // Regular event + // ephemeral events are like regular events + // unknown kind + return e.id; + } + }) } -} - -/** - * A note store that holds a single replaceable event per "pubkey-dtag" - */ -export class ParameterizedReplaceableNoteStore extends KeyedReplaceableNoteStore { - constructor() { - super(ev => { - const dTag = findTag(ev, "d"); - return `${ev.pubkey}-${dTag}`; - }); - } -} +} \ No newline at end of file