akiomik / akiomik/nosvelte

useEventList() silently drops everything that is not kind 1

Đang mở
#68 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
bug
Ngôn ngữ chính
TypeScript
Star
29
Fork
3
Merge trung bình
3 giờ 5 phút
Pull request đã merge (30 ngày)
11

Mô tả

`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.

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
typescript
Lĩnh vực
frontend
Loại issue
Lỗi
Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức độ hoạt động
Ít trao đổi
Độ rõ ràng
Cần làm rõ
Mức phù hợp với người mới
35/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.