~ knotless Search/
↑↓ move↵ open⇧↵ all results

chadtmiller.com/knotless

git that lives in your Atmosphere account

knotless.dev
1 collaborator

knotless 0.13.0 Latest 2 packages, 1 image

1
10

Owners' notifications check blocks and hides through their index

Merged chadtmiller.com asked to merge into main from chadtmiller.com/knotless:serve/notifications-owned-watch-speed
crates/knotless-serve/src/index.rs+8−2
@@ -2191,8 +2191,10 @@ impl Index {
UNION SELECT value, NULL FROM json_each(?5)),
-- What it chose to hear of: a repository it watches, by
-- owner and key, or a pull or an issue it subscribed to or
-- muted, by URI; each since when it chose.
subs(subject, did, key, level, at, releases) AS (SELECT value ->> '$.subject',
-- muted, by URI; each since when it chose. Read from its
-- JSON once: inlined, `json_each` parses it again for each
-- row heard of, and an owner's every repository is in it.
subs(subject, did, key, level, at, releases) AS MATERIALIZED (SELECT value ->> '$.subject',
value ->> '$.did', value ->> '$.key', value ->> '$.level', value ->> '$.at',
value ->> '$.releases'
FROM json_each(?7)),
@@ -2347,6 +2349,9 @@ impl Index {
AND NOT EXISTS (SELECT 1 FROM forge o
WHERE o.author = f.repo_did AND o.repo_did = f.repo_did
AND o.repo_key = f.repo_key
-- As `forge_moderation` says, for its few rows: without
-- it, every record of the repository, for each heard of.
AND (instr(o.uri, '/dev.knotless.block/') OR instr(o.uri, '/dev.knotless.hide/'))
AND ((instr(o.uri, '/dev.knotless.block/')
AND o.value ->> '$.subject' = f.author)
OR (instr(o.uri, '/dev.knotless.hide/')
@@ -2402,6 +2407,7 @@ impl Index {
AND NOT EXISTS (SELECT 1 FROM forge o
WHERE o.author = w.repo_did AND o.repo_did = w.repo_did
AND o.repo_key = w.repo_key
AND (instr(o.uri, '/dev.knotless.block/') OR instr(o.uri, '/dev.knotless.hide/'))
AND ((instr(o.uri, '/dev.knotless.block/')
AND o.value ->> '$.subject' = w.author)
OR (instr(o.uri, '/dev.knotless.hide/')