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.

贡献指南

这个仓库没有索引到贡献指南

调研方向

Start in src/lib/stores/operators.ts and compare useEventList with the kind-1 filtering used by useTextList; then inspect useText.ts, EventList, and useEvent for the public API relationship. Verify the v0.6.1 behavior with a non-kind-1 event. Done means the API direction is decided, its breaking-change implications are documented, and the affected names behave consistently.

由索引模型根据 Issue 内容生成。

评估

技术栈
typescript
领域
frontend
Issue 类型
缺陷
难度
5/5
预计耗时
一周以上
活跃度
冷清
描述清晰度
需要澄清
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。