akiomik / akiomik/nosvelte

An operator error discards already-rendered data and cannot be recovered from

Đang mở
#84 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ả

When an operator in the pipe throws, the RxJS stream terminates permanently and
`useReq()` has no way back:

- the local `error` store is set (`src/lib/stores/useReq.ts:88-97`) and is only ever
cleared at the start of a `queryFn` run (`:50`);
- if the query had already resolved, `queryFn` will not run again on its own;
- the derived `status` prefers the local error over the query's state (`:126`), so
it reports `'error'` indefinitely.

Every component checks `{#if $error}` **before** it looks at `$data`
(`Text.svelte:32`, `EventList.svelte:32`, and the same line in the other nine), so
data that was already rendered is discarded and the component is stuck on the error
slot until something calls `invalidateQueries` by hand.

A stream that fails after delivering 50 events leaves the consumer with an error
slot and no way to show the 50 events it still holds.

Determined by code reading.

## Direction

Whether to discard already-delivered data on error is the consumer's decision, not
the library's. The result shape should be able to represent "errored, and here is
what we had" rather than forcing the two apart.

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 by reading src/lib/stores/useReq.ts, especially lines 50, 88-97, and 126, then compare the error-first rendering in Text.svelte, EventList.svelte, and the other nine components. Trace how a stream error affects previously delivered data and define a result shape that preserves both; done means consumers can choose whether to show retained data or the error state.

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
Tính năng
Độ 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
Khá rõ ràng
Mức phù hợp với người mới
42/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.