fix: eliminate reconnect duplicate logs with KMP dedup (FAR-105) #4
Reference in New Issue
Block a user
Delete Branch "fix/far-105-dedup-kmp-v2"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
sinceSecondscauses K8s to re-stream an overlap window of already-sent content, which the previous code forwarded toonLogverbatim — causing repeated lines in the UI (e.g. 42× "Let me watch the new pod and see if it works.")findNewLogContent()strips any prefix of the buffered data that overlaps with already-sent content (using the KMP failure-function in O(N)), and only the genuinely new suffix is forwarded toonLog.accumulatedreplacesallChunksas the single source of truth for both dedup and the final parsed output — so the parsed JSON is also deduplication-clean.How it works
Test plan
npm run typecheck— cleannpm test— 200/200 passed🤖 Generated with Claude Code
Pull request closed