feat(session-ingest): gate remote session pushes by user#4639
Conversation
Co-authored-by: kiloconnect[bot] <240665456+kiloconnect[bot]@users.noreply.github.com>
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Executive SummaryThe rollout gate correctly replaces the disabled flag with an exact single-user-ID comparison, is consistently threaded through both the direct-ingest and queue-consumer dispatch paths, and is covered by tests for the disabled, non-matching, and matching-user cases. Files Reviewed (8 files)
Reviewed by claude-sonnet-5 · Input: 20 · Output: 3.9K · Cached: 392.6K Review guidance: REVIEW.md from base branch |
| deps: DispatchRemoteSessionAttentionDeps | ||
| ): Promise<DispatchRemoteSessionAttentionOutcome> { | ||
| if (!REMOTE_SESSION_ATTENTION_PUSH_ENABLED) { | ||
| if (deps.remoteSessionAttentionPushUserId?.trim() !== params.kiloUserId) { |
There was a problem hiding this comment.
Low, Functional: This trims remoteSessionAttentionPushUserId before comparing it to params.kiloUserId, but does not guard against params.kiloUserId being empty. If kiloUserId were ever an empty string and the env var were unset or empty, ''.trim() === '' would be true and the gate would incorrectly pass instead of suppressing. There's no code path today that produces an empty kiloUserId, so this is a defensive gap rather than an active bug. Suggest adding an explicit guard, e.g. if (!params.kiloUserId || deps.remoteSessionAttentionPushUserId?.trim() !== params.kiloUserId), so the empty string case is not incidentally treated as a match.
Summary
Validation