Skip to content

Commit d9da347

Browse files
committed
tests WIP
1 parent 64063c3 commit d9da347

File tree

2 files changed

+1369
-0
lines changed

2 files changed

+1369
-0
lines changed
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
## Issues Exposed by the Real Tests:
2+
3+
### 1. **EmptyError Issues**
4+
5+
Many tests fail with `EmptyError: no elements in sequence` - the real `defaultApplyEvents` implementation doesn't emit values properly, causing the RxJS pipeline to complete without emitting anything.
6+
7+
### 2. **Missing onEvent Callback** ✅ (as you expected)
8+
9+
```
10+
Expected number of calls: 2
11+
Received number of calls: 0
12+
```
13+
14+
The real implementation does NOT call the generic `onEvent` callback, confirming this is missing.
15+
16+
### 3. **Buffer Logic Mismatch** ✅ (as you pointed out)
17+
18+
```
19+
TypeError: Cannot read properties of undefined (reading 'content')
20+
at textMessageBuffer: messages[messages.length - 1].content ?? ""
21+
```
22+
23+
The real implementation tries to use `messages[messages.length - 1].content` as the buffer, but the message doesn't exist because the implementation doesn't actually create messages from events.
24+
25+
### 4. **Message Creation Not Working** ✅ (as you pointed out)
26+
27+
The implementation doesn't create messages from `TEXT_MESSAGE_START`/`CONTENT`/`END` events - that's why `messages[messages.length - 1]` is undefined.
28+
29+
### 5. **Tool Call Buffer Issues**
30+
31+
The tool call buffering is broken - showing empty buffers `""` and wrong tool call names `""` instead of the actual accumulated content.
32+
33+
### 6. **Error Handling Not Implemented** ✅ (as you noted)
34+
35+
```
36+
Error: First subscriber error
37+
```
38+
39+
Subscriber errors crash instead of being handled gracefully - the real implementation doesn't have error handling.
40+
41+
### 7. **State Mutation Issues**
42+
43+
```
44+
Expected: {"modifiedBySubscriber": true}
45+
Received: {"newCounter": 100}
46+
```
47+
48+
The state mutations aren't working as expected.
49+
50+
## Summary
51+
52+
The tests are now correctly exposing that the real implementation is missing:
53+
54+
-**onEvent callback invocation** (0 calls instead of expected)
55+
-**Message creation from events** (messages array stays empty)
56+
-**Proper buffer accumulation** (trying to read non-existent message content)
57+
-**Error handling** (errors crash instead of being handled)
58+
- **Tool call buffer management** (buffers stay empty)
59+
- **Event pipeline completion** (EmptyError suggests pipeline issues)
60+
61+
The tests are now authentic - they test against the real implementation and fail where the implementation has bugs, rather than passing against artificial mocks that don't reflect reality.

0 commit comments

Comments
 (0)