Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
There was a problem hiding this comment.
2 issues found across 6 files
Prompt for AI agents (all 2 issues)
Understand the root cause of the following 2 issues and fix them.
<file name="packages/features/bookings/lib/service/RegularBookingService.ts">
<violation number="1" location="packages/features/bookings/lib/service/RegularBookingService.ts:1282">
Rule violated: **Avoid Logging Sensitive Information**
Remove the log of guestsRemoved; it outputs guest email addresses and violates the Avoid Logging Sensitive Information rule.</violation>
</file>
<file name="packages/lib/server/defaultResponder.ts">
<violation number="1" location="packages/lib/server/defaultResponder.ts:54">
Wrapping every error in TracedError before calling getServerErrorFromUnknown strips the original error type (ErrorWithCode/HttpError), so status-specific responses (409, 404, etc.) now come back as 500. Please pass the original error into getServerErrorFromUnknown or adjust it to unwrap TracedError before classification.</violation>
</file>
React with 👍 or 👎 to teach cubic. Mention @cubic-dev-ai to give feedback, ask questions, or re-run the review.
There was a problem hiding this comment.
3 issues found across 6 files
Prompt for AI agents (all 3 issues)
Understand the root cause of the following 3 issues and fix them.
<file name="packages/features/bookings/lib/service/RegularBookingService.ts">
<violation number="1" location="packages/features/bookings/lib/service/RegularBookingService.ts:1282">
Rule violated: **Avoid Logging Sensitive Information**
Do not emit guest email addresses to the trace logs. Logging guestsRemoved writes the raw attendee emails, which are PII and must be withheld from logs to comply with the sensitive-data logging policy.</violation>
</file>
<file name="apps/web/pages/api/book/event.ts">
<violation number="1" location="apps/web/pages/api/book/event.ts:71">
Rule violated: **Avoid Logging Sensitive Information**
Do not log bookingUid; it directly identifies a booking record and leaks sensitive data. Remove this field from the log payload to comply with the "Avoid Logging Sensitive Information" rule.</violation>
</file>
<file name="packages/lib/server/defaultResponder.ts">
<violation number="1" location="packages/lib/server/defaultResponder.ts:55">
Wrapping errors in TracedError before getServerErrorFromUnknown breaks HttpError/TRPCError handling, returning 500 instead of their intended status codes.</violation>
</file>
React with 👍 or 👎 to teach cubic. Mention @cubic-dev-ai to give feedback, ask questions, or re-run the review.
E2E results are ready! |
packages/features/bookings/lib/service/RegularBookingService.ts
Outdated
Show resolved
Hide resolved
packages/features/bookings/lib/service/RegularBookingService.ts
Outdated
Show resolved
Hide resolved
packages/features/bookings/lib/service/RegularBookingService.ts
Outdated
Show resolved
Hide resolved
packages/features/bookings/lib/service/RegularBookingService.ts
Outdated
Show resolved
Hide resolved
packages/features/bookings/lib/service/RegularBookingService.ts
Outdated
Show resolved
Hide resolved
hariombalhara
left a comment
There was a problem hiding this comment.
Left some comments, major problem is something went wrong while resolving conflicts it seems
There was a problem hiding this comment.
1 issue found across 7 files
Prompt for AI agents (all 1 issues)
Understand the root cause of the following 1 issues and fix them.
<file name="packages/features/bookings/lib/service/RegularBookingService.ts">
<violation number="1" location="packages/features/bookings/lib/service/RegularBookingService.ts:1256">
Rule violated: **Avoid Logging Sensitive Information**
Logging `guestsRemoved` outputs the guests’ raw email addresses, violating our no-PII logging policy. Please avoid emitting the actual emails in logs.</violation>
</file>
React with 👍 or 👎 to teach cubic. Mention @cubic-dev-ai to give feedback, ask questions, or re-run the review.
|
|
||
| if (guestsRemoved.length > 0) { | ||
| log.info("Removed guests from the booking", guestsRemoved); | ||
| tracingLogger.info("Removed guests from the booking", guestsRemoved); |
There was a problem hiding this comment.
Rule violated: Avoid Logging Sensitive Information
Logging guestsRemoved outputs the guests’ raw email addresses, violating our no-PII logging policy. Please avoid emitting the actual emails in logs.
Prompt for AI agents
Address the following comment on packages/features/bookings/lib/service/RegularBookingService.ts at line 1256:
<comment>Logging `guestsRemoved` outputs the guests’ raw email addresses, violating our no-PII logging policy. Please avoid emitting the actual emails in logs.</comment>
<file context>
@@ -1233,7 +1253,7 @@ async function handler(
if (guestsRemoved.length > 0) {
- log.info("Removed guests from the booking", guestsRemoved);
+ tracingLogger.info("Removed guests from the booking", guestsRemoved);
}
</file context>
| tracingLogger.info("Removed guests from the booking", guestsRemoved); | |
| tracingLogger.info("Removed guests from the booking", { count: guestsRemoved.length }); |
There was a problem hiding this comment.
2 issues found across 7 files
Prompt for AI agents (all 2 issues)
Understand the root cause of the following 2 issues and fix them.
<file name="packages/features/bookings/lib/service/RegularBookingService.ts">
<violation number="1" location="packages/features/bookings/lib/service/RegularBookingService.ts:1256">
Rule violated: **Avoid Logging Sensitive Information**
Logging `guestsRemoved` leaks guest email addresses to the tracing logger, violating the "Avoid Logging Sensitive Information" rule. Please remove or redact the emails before logging.</violation>
</file>
<file name="packages/lib/server/defaultResponder.ts">
<violation number="1" location="packages/lib/server/defaultResponder.ts:53">
Setting the X-Trace-Id header after the handler runs misses most responses because defaultResponder handlers usually call res.status(...).json(...), which ends the response before this code executes. Please set the header before invoking the handler so it is always attached.</violation>
</file>
React with 👍 or 👎 to teach cubic. Mention @cubic-dev-ai to give feedback, ask questions, or re-run the review.
|
|
||
| if (guestsRemoved.length > 0) { | ||
| log.info("Removed guests from the booking", guestsRemoved); | ||
| tracingLogger.info("Removed guests from the booking", guestsRemoved); |
There was a problem hiding this comment.
Rule violated: Avoid Logging Sensitive Information
Logging guestsRemoved leaks guest email addresses to the tracing logger, violating the "Avoid Logging Sensitive Information" rule. Please remove or redact the emails before logging.
Prompt for AI agents
Address the following comment on packages/features/bookings/lib/service/RegularBookingService.ts at line 1256:
<comment>Logging `guestsRemoved` leaks guest email addresses to the tracing logger, violating the "Avoid Logging Sensitive Information" rule. Please remove or redact the emails before logging.</comment>
<file context>
@@ -1233,7 +1253,7 @@ async function handler(
if (guestsRemoved.length > 0) {
- log.info("Removed guests from the booking", guestsRemoved);
+ tracingLogger.info("Removed guests from the booking", guestsRemoved);
}
</file context>
| tracingLogger.info("Removed guests from the booking", guestsRemoved); | |
| tracingLogger.info("Removed guests from the booking", { count: guestsRemoved.length }); |
|
|
||
| ok = true; | ||
| if (result && !res.writableEnded) { | ||
| res.setHeader("X-Trace-Id", traceContext.traceId); |
There was a problem hiding this comment.
Setting the X-Trace-Id header after the handler runs misses most responses because defaultResponder handlers usually call res.status(...).json(...), which ends the response before this code executes. Please set the header before invoking the handler so it is always attached.
Prompt for AI agents
Address the following comment on packages/lib/server/defaultResponder.ts at line 53:
<comment>Setting the X-Trace-Id header after the handler runs misses most responses because defaultResponder handlers usually call res.status(...).json(...), which ends the response before this code executes. Please set the header before invoking the handler so it is always attached.</comment>
<file context>
@@ -17,22 +25,37 @@ export function defaultResponder<T>(
ok = true;
if (result && !res.writableEnded) {
+ res.setHeader("X-Trace-Id", traceContext.traceId);
return res.json(result);
}
</file context>
What does this PR do?
Ref:- #22969
Splitting PR feat: distributed tracing #24055
This is Part two after #24717
Mandatory Tasks (DO NOT REMOVE)
How should this be tested?
Summary by cubic
Adds distributed tracing to API and tRPC requests. Propagates a trace context, adds structured logging, and returns an X-Trace-Id header to improve debugging and meet tracing rollout requirements.
Written for commit cfc9bd4. Summary will update automatically on new commits.