⚠ This page is served via a proxy. Original site: https://github.com
This service does not collect credentials or authentication data.
Skip to content

Conversation

@paustint
Copy link
Contributor

Enhance the handling of aborted download jobs to prevent unnecessary closure attempts and improve logging for zip job completion. Update logging practices to ensure more context is captured in log events.

Copilot AI review requested due to automatic review settings January 16, 2026 15:30
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request enhances error handling for aborted download jobs and improves logging throughout the application. The changes prevent unnecessary stream closure attempts and add more contextual information to log events.

Changes:

  • Introduce a controllerClosed flag in StreamingZip to prevent attempting to close an already-closed controller
  • Add contextual logging for zip file download lifecycle events (start, completion, abort)
  • Refactor Rollbar error reporting to flatten the structure by removing nested custom objects
  • Update logger selection to prefer res.log over req.log and pass the response object to getOrgFromHeaderOrQuery

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
libs/salesforce-api/src/lib/zip-utils.ts Adds controllerClosed flag to track stream closure state and prevents redundant close attempts
libs/salesforce-api/src/lib/api-binary-download.ts Adds contextual logging for zip download lifecycle (start/completion/abort)
apps/api/src/app/utils/route.utils.ts Updates logger selection to prefer res.log and flattens Rollbar custom data structure
apps/api/src/app/utils/response.handlers.ts Flattens Rollbar custom data structure for consistency
apps/api/src/app/services/user-feedback.service.ts Flattens Rollbar custom data structure
apps/api/src/app/services/salesforce-org-encryption.service.ts Flattens Rollbar custom data structure
apps/api/src/app/services/jwt-token-encryption.service.ts Flattens Rollbar custom data structure
apps/api/src/app/routes/route.middleware.ts Updates getOrgFromHeaderOrQuery signature to accept res parameter for improved logger access
apps/api/src/app/routes/platform-event.routes.ts Updates function call to match new getOrgFromHeaderOrQuery signature
apps/api/src/app/controllers/oauth.controller.ts Adds logger parameter to ApiConnection instantiation

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

If stream was already aborted (aka closed) don't try to close again.

improved logging on zip job completion

Ref: rollbar-2292
Ensure we are using res.log to get as much context as possible in the log object

Remove the "custom" key from rollbar log events
@paustint paustint force-pushed the bug/improve-download-errors branch from 65a7293 to 46b95dd Compare January 17, 2026 14:11
@paustint paustint merged commit 0feffbe into main Jan 19, 2026
9 checks passed
@paustint paustint deleted the bug/improve-download-errors branch January 19, 2026 15:58
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