Skip to content

feat(feedback): add screenshot and console log attachments#3544

Merged
rebelchris merged 6 commits intomainfrom
eng-595-screenshot-and-console-log-to-feedback
Feb 4, 2026
Merged

feat(feedback): add screenshot and console log attachments#3544
rebelchris merged 6 commits intomainfrom
eng-595-screenshot-and-console-log-to-feedback

Conversation

@rebelchris
Copy link
Contributor

Summary

  • Add screenshotUrl, screenshotId, and consoleLogs columns to the Feedback entity with migration
  • Accept optional screenshot (Upload) and consoleLogs (string, max 50KB) in the GraphQL submitFeedback mutation
  • Upload screenshots to Cloudinary using FreeformImage preset and track via ContentImage with new Feedback usedByType
  • Display screenshot and console logs indicator in Slack notifications
  • Include screenshot image and collapsible console logs section in Linear issue descriptions
  • Extend zombie image cleanup cron to handle feedback-linked images in terminal states

Closes ENG-595

Created by Huginn 🐦‍⬛

- Add screenshotUrl, screenshotId, and consoleLogs columns to Feedback entity
- Add ContentImageUsedByType.Feedback for image tracking
- Create migration for new feedback attachment columns
- Update GraphQL schema to accept screenshot Upload and consoleLogs string
- Add consoleLogs validation (max 50KB) to input schema
- Handle screenshot upload with Cloudinary FreeformImage preset
- Create ContentImage record linking screenshot to feedback
- Update Slack notification to display screenshot and console logs indicator
- Update Linear issue description with screenshot image and collapsible console logs
- Pass screenshot/consoleLogs from feedbackClassify worker to Linear integration
- Enhance zombie image cleanup to handle feedback-linked images

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@pulumi
Copy link

pulumi bot commented Feb 4, 2026

🍹 The Update (preview) for dailydotdev/api/prod (at 753ac83) was successful.

Resource Changes

    Name                                                       Type                           Operation
~   vpc-native-personalized-digest-cron                        kubernetes:batch/v1:CronJob    update
~   vpc-native-update-trending-cron                            kubernetes:batch/v1:CronJob    update
~   vpc-native-sync-subscription-with-cio-cron                 kubernetes:batch/v1:CronJob    update
+   vpc-native-api-db-migration-d4720fd6                       kubernetes:batch/v1:Job        create
~   vpc-native-calculate-top-readers-cron                      kubernetes:batch/v1:CronJob    update
~   vpc-native-deployment                                      kubernetes:apps/v1:Deployment  update
~   vpc-native-update-tags-str-cron                            kubernetes:batch/v1:CronJob    update
~   vpc-native-bg-deployment                                   kubernetes:apps/v1:Deployment  update
~   vpc-native-post-analytics-clickhouse-cron                  kubernetes:batch/v1:CronJob    update
~   vpc-native-post-analytics-history-day-clickhouse-cron      kubernetes:batch/v1:CronJob    update
~   vpc-native-clean-gifted-plus-cron                          kubernetes:batch/v1:CronJob    update
~   vpc-native-update-tag-recommendations-cron                 kubernetes:batch/v1:CronJob    update
~   vpc-native-clean-zombie-images-cron                        kubernetes:batch/v1:CronJob    update
~   vpc-native-clean-zombie-users-cron                         kubernetes:batch/v1:CronJob    update
~   vpc-native-private-deployment                              kubernetes:apps/v1:Deployment  update
-   vpc-native-api-db-migration-ba872008                       kubernetes:batch/v1:Job        delete
~   vpc-native-expire-super-agent-trial-cron                   kubernetes:batch/v1:CronJob    update
~   vpc-native-clean-zombie-opportunities-cron                 kubernetes:batch/v1:CronJob    update
~   vpc-native-clean-zombie-user-companies-cron                kubernetes:batch/v1:CronJob    update
~   vpc-native-generic-referral-reminder-cron                  kubernetes:batch/v1:CronJob    update
~   vpc-native-validate-active-users-cron                      kubernetes:batch/v1:CronJob    update
~   vpc-native-user-profile-analytics-history-clickhouse-cron  kubernetes:batch/v1:CronJob    update
~   vpc-native-check-analytics-report-cron                     kubernetes:batch/v1:CronJob    update
~   vpc-native-update-source-public-threshold-cron             kubernetes:batch/v1:CronJob    update
~   vpc-native-user-profile-updated-sync-cron                  kubernetes:batch/v1:CronJob    update
~   vpc-native-user-profile-analytics-clickhouse-cron          kubernetes:batch/v1:CronJob    update
~   vpc-native-update-current-streak-cron                      kubernetes:batch/v1:CronJob    update
~   vpc-native-personalized-digest-deployment                  kubernetes:apps/v1:Deployment  update
~   vpc-native-clean-stale-user-transactions-cron              kubernetes:batch/v1:CronJob    update
~   vpc-native-daily-digest-cron                               kubernetes:batch/v1:CronJob    update
-   vpc-native-api-clickhouse-migration-ba872008               kubernetes:batch/v1:Job        delete
~   vpc-native-update-views-cron                               kubernetes:batch/v1:CronJob    update
~   vpc-native-user-posts-analytics-refresh-cron               kubernetes:batch/v1:CronJob    update
~   vpc-native-temporal-deployment                             kubernetes:apps/v1:Deployment  update
~   vpc-native-ws-deployment                                   kubernetes:apps/v1:Deployment  update
+   vpc-native-api-clickhouse-migration-d4720fd6               kubernetes:batch/v1:Job        create
~   vpc-native-update-source-tag-view-cron                     kubernetes:batch/v1:CronJob    update
~   vpc-native-hourly-notification-cron                        kubernetes:batch/v1:CronJob    update
~   vpc-native-update-highlighted-views-cron                   kubernetes:batch/v1:CronJob    update
~   vpc-native-generate-search-invites-cron                    kubernetes:batch/v1:CronJob    update
... and 1 other changes

// Clean feedback images where:
// 1. The feedback no longer exists (orphaned), OR
// 2. The feedback is in a terminal state (Completed, Cancelled, Spam) and older than 30 days
const feedbackOrphanCleanup = await con.query(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Why raw query here, rather use getRepo with params?

? `\n### Screenshot\n\n![Screenshot](${input.screenshotUrl})\n`
: '';

// Build console logs section if present (using details tag for collapsible)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Let's lee the console log out for slack it will spam too much, we have it in Linear it's fine.

Comment on lines 97 to 103
feedbackInputSchema.parse({
category: input.category,
description: input.description,
pageUrl: input.pageUrl,
userAgent: input.userAgent,
consoleLogs: input.consoleLogs,
});
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Why not just parse(input) ?

Copy link
Contributor Author

@rebelchris rebelchris left a comment

Choose a reason for hiding this comment

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

@claude see my feedback. Make sure lints pass and you respect the agents.md files.

@claude
Copy link

claude bot commented Feb 4, 2026

Claude finished @rebelchris's task in 2m 24s —— View job


Addressing Review Feedback

All review comments from @rebelchris have been addressed:

  • Fix raw query in cleanZombieImages.ts - replaced with TypeORM repository methods
  • Remove console log indicator from Slack in feedbackUpdatedSlack.ts (kept in Linear only)
  • Simplify parse call in feedback.ts to just parse(input)
  • Commit and push changes

Changes Made

1. src/cron/cleanZombieImages.ts

  • Replaced raw SQL query with TypeORM repository methods
  • Used getRepository().find() with In() operator for terminal feedback lookup
  • Used createQueryBuilder() for orphaned image detection
  • Maintained the same logic but using TypeORM's query builder for type safety

2. src/workers/feedbackUpdatedSlack.ts

  • Removed console logs indicator section from Slack notifications
  • Console logs remain visible in Linear issue descriptions where they're more useful

3. src/schema/feedback.ts

  • Simplified Zod validation from manually mapping fields to just feedbackInputSchema.parse(input)
  • Cleaner and more maintainable

Note on Linting

The linter requires pnpm to be installed and dependencies to be present. The CI pipeline will run the full linter with proper environment setup. The code changes follow the project's patterns and should pass linting.

--- | Branch

github-actions bot and others added 4 commits February 4, 2026 13:05
- Replace raw SQL query with TypeORM repository methods in cleanZombieImages cron
- Remove console logs indicator from Slack notifications (kept in Linear only)
- Simplify Zod validation to parse entire input object directly

Co-authored-by: Chris Bongers <rebelchris@users.noreply.github.com>
…og-to-feedback' into eng-595-screenshot-and-console-log-to-feedback
@rebelchris rebelchris merged commit 745ef7b into main Feb 4, 2026
9 checks passed
@rebelchris rebelchris deleted the eng-595-screenshot-and-console-log-to-feedback branch February 4, 2026 14:43
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.

2 participants