(janitor/dedupe): consolidate webhook user ID path encoding into worker-utils - #6203
Open
kilo-code-bot[bot] wants to merge 1 commit into
Open
kilo-code-bot[bot] wants to merge 1 commit into
kilo-code-bot[bot] wants to merge 1 commit into
Conversation
…er-utils encodeUserIdForPath/decodeUserIdFromPath were duplicated verbatim across apps/web and services/webhook-agent-ingest. The web client encodes webhook URL paths while the ingest worker decodes them, so drift silently breaks webhook routing. Both packages already depend on @kilocode/worker-utils, which becomes the single owner.
Contributor
Author
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Executive SummaryVerified the verbatim relocation of Overview
Verification Notes
Files Reviewed (9 files)
Reviewed by deepseek-v4.1-flash · Input: 0 · Output: 0 · Cached: 0 Review guidance: REVIEW.md from base branch |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
encodeUserIdForPath/decodeUserIdFromPathwere duplicated across two packages:apps/web/src/lib/webhook-agent/user-id-encoding.ts(encode only)services/webhook-agent-ingest/src/util/user-id-encoding.ts(encode + decode)The web client builds webhook URL paths with
encodeUserIdForPath, and the ingest worker parses them withdecodeUserIdFromPath. They are two halves of the same domain concept and must change together: if they drift, webhook routing silently breaks.Change
Both
apps/webandcloudflare-webhook-agent-ingestalready depend on@kilocode/worker-utils, so it becomes the single owner of the concept. This is a shared behavior consolidation, not an abstraction: the duplicated implementation and its test are moved verbatim, then the call sites import from the shared package.@kilocode/worker-utils/user-id-encoding(encode + decode) and its tests.Verification
tsgo --noEmitpasses forpackages/worker-utils,services/webhook-agent-ingest, andapps/web.vitest run src/user-id-encoding.test.ts(worker-utils): 12 passed.vitest run src/routes/api.test.ts(webhook-agent-ingest): 29 passed.oxlintandoxfmt --list-differentclean on all changed files.Postgres/Redis were not needed for this change.