Commit 5752eb4
committed
Fix SSE JSON payload and empty stream offset bugs
Fixes identified during code review:
1. JSON SSE payload trailing comma bug:
- processJsonAppend adds trailing commas for storage
- SSE was wrapping raw data in [], producing invalid JSON like [{"id":1},]
- Now uses formatResponse() which properly strips trailing commas
2. Empty stream offset bug:
- SSE control events were using initialOffset (-1) for empty streams
- HTTP GET uses stream.currentOffset for empty results
- SSE now computes controlOffset the same way as HTTP GET
3. Strengthened conformance tests:
- JSON SSE test now parses payload and verifies it's valid JSON
- Empty stream test verifies SSE offset matches HTTP GET offset1 parent 6103662 commit 5752eb4
2 files changed
+48
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2457 | 2457 | | |
2458 | 2458 | | |
2459 | 2459 | | |
2460 | | - | |
| 2460 | + | |
2461 | 2461 | | |
2462 | 2462 | | |
2463 | 2463 | | |
| |||
2499 | 2499 | | |
2500 | 2500 | | |
2501 | 2501 | | |
2502 | | - | |
2503 | | - | |
| 2502 | + | |
| 2503 | + | |
| 2504 | + | |
| 2505 | + | |
| 2506 | + | |
| 2507 | + | |
| 2508 | + | |
| 2509 | + | |
| 2510 | + | |
| 2511 | + | |
| 2512 | + | |
| 2513 | + | |
| 2514 | + | |
2504 | 2515 | | |
2505 | 2516 | | |
2506 | 2517 | | |
| |||
2509 | 2520 | | |
2510 | 2521 | | |
2511 | 2522 | | |
2512 | | - | |
| 2523 | + | |
2513 | 2524 | | |
2514 | 2525 | | |
2515 | 2526 | | |
| |||
2518 | 2529 | | |
2519 | 2530 | | |
2520 | 2531 | | |
| 2532 | + | |
| 2533 | + | |
| 2534 | + | |
| 2535 | + | |
| 2536 | + | |
| 2537 | + | |
2521 | 2538 | | |
2522 | 2539 | | |
2523 | 2540 | | |
| |||
2550 | 2567 | | |
2551 | 2568 | | |
2552 | 2569 | | |
| 2570 | + | |
| 2571 | + | |
| 2572 | + | |
| 2573 | + | |
| 2574 | + | |
| 2575 | + | |
| 2576 | + | |
| 2577 | + | |
| 2578 | + | |
| 2579 | + | |
| 2580 | + | |
| 2581 | + | |
| 2582 | + | |
| 2583 | + | |
2553 | 2584 | | |
2554 | 2585 | | |
2555 | 2586 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
515 | 515 | | |
516 | 516 | | |
517 | 517 | | |
| 518 | + | |
518 | 519 | | |
519 | 520 | | |
520 | 521 | | |
| |||
537 | 538 | | |
538 | 539 | | |
539 | 540 | | |
540 | | - | |
541 | | - | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
542 | 544 | | |
543 | | - | |
| 545 | + | |
544 | 546 | | |
545 | 547 | | |
546 | 548 | | |
| |||
550 | 552 | | |
551 | 553 | | |
552 | 554 | | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
553 | 559 | | |
554 | 560 | | |
555 | | - | |
| 561 | + | |
556 | 562 | | |
557 | 563 | | |
558 | 564 | | |
| |||
561 | 567 | | |
562 | 568 | | |
563 | 569 | | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
564 | 573 | | |
565 | 574 | | |
566 | 575 | | |
| |||
0 commit comments