Skip to content

debug(log): Add logging on socket token error#4051

Merged
TheodoreSpeaks merged 1 commit intostagingfrom
log/add-socket-error-log
Apr 8, 2026
Merged

debug(log): Add logging on socket token error#4051
TheodoreSpeaks merged 1 commit intostagingfrom
log/add-socket-error-log

Conversation

@TheodoreSpeaks
Copy link
Copy Markdown
Collaborator

Summary

We have a bunch of socket-token errors but no way to debug further. Adding a log line so we can see what failed.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation
  • Other: ___________

Testing

  • Logging change with low impact, just manually reviewed.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

Screenshots/Videos

@cursor
Copy link
Copy Markdown

cursor bot commented Apr 8, 2026

PR Summary

Low Risk
Low risk: adds error logging in the socket token API without changing auth/token generation behavior or responses (beyond capturing error details in logs).

Overview
Adds a SocketTokenAPI logger to the POST handler for api/auth/socket-token and logs the error message/stack when generateOneTimeToken throws.

The endpoint’s JSON responses remain the same (still returning 500 with Failed to generate token on exceptions), but failures now include structured diagnostics in server logs.

Reviewed by Cursor Bugbot for commit 874813b. Bugbot is set up for automated code reviews on this repo. Configure here.

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 8, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Apr 8, 2026 6:23pm

Request Review

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Apr 8, 2026

Greptile Summary

This PR adds structured error logging to the socket-token API route's catch block, replacing a bare catch clause with one that captures and logs the error message and stack trace via the project-standard createLogger from @sim/logger.

Confidence Score: 5/5

Safe to merge — minimal, targeted logging addition with no behavioral changes.

The change is a single-file, additive logging improvement. It correctly uses the project-standard createLogger, applies proper instanceof Error type guards, logs to the server only (no data leakage to the client), and leaves all existing control flow intact.

No files require special attention.

Vulnerabilities

No security concerns identified. The error object is serialized server-side into structured log fields only; the client-facing response continues to return a generic "Failed to generate token" message with no internal details exposed.

Important Files Changed

Filename Overview
apps/sim/app/api/auth/socket-token/route.ts Adds structured error logging using createLogger; uses correct instanceof guards, follows project logging standards, no issues found.

Reviews (1): Last reviewed commit: "debug(log): Add logging on socket token ..." | Re-trigger Greptile

@TheodoreSpeaks TheodoreSpeaks merged commit a1173ee into staging Apr 8, 2026
12 checks passed
@TheodoreSpeaks TheodoreSpeaks deleted the log/add-socket-error-log branch April 8, 2026 18:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant