correctly rejects parameterized replaceable that is older than current
This commit is contained in:
@@ -100,7 +100,6 @@ func (r *T) QueryEvents(c Ctx, f *filter.T) (evs []*event.T, err E) {
|
||||
if len(rem) > 0 {
|
||||
log.T.S(rem)
|
||||
}
|
||||
log.I.S(ev)
|
||||
// check if this matches the other filters that were not part of the index.
|
||||
if extraFilter == nil || extraFilter.Matches(ev) {
|
||||
// check if this event is replaced by one we already have in the result.
|
||||
@@ -114,6 +113,9 @@ func (r *T) QueryEvents(c Ctx, f *filter.T) (evs []*event.T, err E) {
|
||||
}
|
||||
}
|
||||
}
|
||||
// log.I.S(ev.Tags.GetFirst(tag.New("d")).Value(),
|
||||
// ev.Tags.GetFirst(tag.New("d")).Value())
|
||||
|
||||
if ev.Kind.IsParameterizedReplaceable() &&
|
||||
ev.Tags.GetFirst(tag.New("d")) != nil {
|
||||
for _, evc := range evs {
|
||||
|
||||
@@ -10,7 +10,6 @@ import (
|
||||
"realy.lol/kinds"
|
||||
"realy.lol/normalize"
|
||||
"realy.lol/tag"
|
||||
"realy.lol/tags"
|
||||
"realy.lol/ws"
|
||||
)
|
||||
|
||||
@@ -61,9 +60,11 @@ func (w RelayWrapper) Publish(c Ctx, evt *event.T) (err E) {
|
||||
f.Authors = tag.New(evt.PubKey)
|
||||
f.Kinds = kinds.New(evt.Kind)
|
||||
d := evt.Tags.GetFirst(tag.New("d", ""))
|
||||
f.Tags = tags.New(tag.New(d.Key(), d.Value()))
|
||||
log.I.F("filter for parameterized replaceable %s", f.Serialize())
|
||||
log.I.S(d)
|
||||
// f.Tags = tags.New(tag.New(d.Key())) // ), d.Value()))
|
||||
log.I.F("filter for parameterized replaceable %s %s", f.Tags, f.Serialize())
|
||||
evs, err = w.I.QueryEvents(c, f)
|
||||
log.I.S(evs)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to query before replacing: %w", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user