akiomik / akiomik/nosvelte

useEventList() silently drops everything that is not kind 1

未關閉
#68 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
bug
主要語言
TypeScript
星號
29
分支
3
平均合併
3 小時 5 分鐘
30 天內合併 PR
11

描述

`useEventList(rxNostr, key, ids)` requests the given ids and then filters the
results with `filterTextList()`, which requires `kind === 1`
(`src/lib/stores/operators.ts`). Anything else is discarded without a trace.

Verified on v0.6.1:

```
useEventList(..., ['e-1']) relay answers with a kind-30023 event carrying id 'e-1'
→ status: 'success', data: []
```

`EventList` renders its `nodata` slot, so a caller asking for ids they know
exist sees an empty list and no error.

The behaviour is right for `useTextList`/`TextList`, which is the same function
re-exported under a different name (`useText.ts` does the same for `useEvent`).
It is the name `useEventList` that promises something it doesn't do — and
`useEvent`, its single-event counterpart, has no such kind restriction, so the
pair is inconsistent with itself.

## Deciding what to do

Not obvious enough to just pick:

- Make `useEventList`/`EventList` kind-agnostic (filter by id only) and leave
`useTextList`/`TextList` as the kind-1 wrapper. Matches the names and matches
`useEvent`, but changes what existing `useEventList` callers receive.
- Keep the behaviour and drop the `useEventList` name, leaving only
`useTextList`. Honest, but removes public API.

Either way it is a breaking change for someone, so it wants a minor release
rather than a patch.

貢獻指南

這個儲存庫沒有索引到貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。