Skip to content

Add debug logging to Slack cookie extraction pipeline#37

Merged
devxoul merged 2 commits intomainfrom
fix/slack-cookie-debug-logging
Mar 5, 2026
Merged

Add debug logging to Slack cookie extraction pipeline#37
devxoul merged 2 commits intomainfrom
fix/slack-cookie-debug-logging

Conversation

@devxoul
Copy link
Owner

@devxoul devxoul commented Mar 5, 2026

Summary

  • Cookie extraction has many silent failure paths that all return '' with no indication of what went wrong. Add an optional debugLog callback to TokenExtractor that logs at each decision point in the cookie pipeline.
  • Wire the callback from auth extract --debug so users can see exactly where cookie extraction fails.

Changes

src/platforms/slack/token-extractor.ts

  • Add optional debugLog callback parameter to constructor.
  • Add debug() helper that calls the callback when set.
  • Log at each failure point in extractCookieFromSQLite() and readCookieFromDB(): file not found, copy failure, no row, plaintext vs encrypted, decryption success/failure.
  • Log Keychain key derivation status in getDerivedKeyAsync().

src/platforms/slack/commands/auth.ts

  • Pass debugLog callback to TokenExtractor when --debug is set.

src/platforms/slack/token-extractor.test.ts

  • Test that debugLog callback receives messages during extraction.
  • Test that omitting debugLog does not throw.

Verified

  • bun test — 264 pass, 0 fail (all Slack tests).
  • bun typecheck — clean.
  • bun lint — clean.

Summary by cubic

Add optional debug logging to the Slack cookie extraction pipeline so users can see why extraction fails. The auth extract command now forwards --debug to print step-by-step logs.

  • New Features
    • TokenExtractor accepts an optional debugLog callback.
    • Logs key decision points: file/path selection, copy errors, no SQL rows, plaintext vs encrypted values, decryption success/failure, and SQL errors.
    • Reports Keychain key derivation status (cached, derived, failed, or skipped on non-darwin).
    • auth extract passes debugLog when --debug is set; tests cover logging and no-callback behavior.

Written for commit f5f5d66. Summary will update on new commits.

@vercel
Copy link

vercel bot commented Mar 5, 2026

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
agent-messenger Ignored Ignored Mar 5, 2026 0:37am

Request Review

Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 3 files

devxoul added 2 commits March 5, 2026 21:36
The cookie extraction has many silent failure paths (file not found, SQL
query empty, decryption failed, Keychain denied) that all return empty
string with no indication of what went wrong. Add an optional debugLog
callback that logs at each decision point.
Pass a debugLog callback when --debug is set so cookie extraction
failure details appear in the debug output.
@devxoul devxoul force-pushed the fix/slack-cookie-debug-logging branch from f1c9c0d to f5f5d66 Compare March 5, 2026 12:37
@devxoul devxoul merged commit e7bd387 into main Mar 5, 2026
4 checks passed
@devxoul devxoul deleted the fix/slack-cookie-debug-logging branch March 5, 2026 12:38
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