Skip to content

Commit

Permalink
Switch to simpler key query
Browse files Browse the repository at this point in the history
  • Loading branch information
Powersource committed Oct 26, 2023
1 parent 3425b27 commit bb64b76
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions lib/epochs.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ const {
and,
type,
live,
key,
isDecrypted,
toPullStream,
} = require('ssb-db2/operators')
const { seekKey } = require('ssb-db2/seekers')
const {
validator: {
group: {
Expand All @@ -37,7 +37,6 @@ const isSubsetOf = require('set.prototype.issubsetof')
const { groupRecp } = require('./operators')
const getTangleUpdates = require('./tangles/get-tangle-updates')
const pullMany = require('pull-many')
const { equal } = require('jitdb/operators')

const msgPattern = toPattern(new Butt64('ssb:message/[a-zA-Z0-9-]+/', null, 32))
const feedPattern = toPattern(new Butt64('ssb:feed/[a-zA-Z0-9-]+/', null, 32))
Expand Down Expand Up @@ -526,15 +525,7 @@ function getRootVal(ssb, msgId, cb) {
pull(
pullMany([
ssb.db.query(
where(
and(
isDecrypted('box2'),
equal(seekKey, toMessageSigil(msgId), {
indexType: 'groupRootMsgId',
prefix: true,
})
)
),
where(and(isDecrypted('box2'), key(toMessageSigil(msgId)))),
live({ old: true }),
toPullStream()
),
Expand Down

0 comments on commit bb64b76

Please sign in to comment.