Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 29, 2025

Logging statements in S3Writer were executed for side-effects but their F[Unit] results were discarded, preventing the logs from actually being emitted.

Changes

  • createS3Client: Use flatTap to sequence the logging effect after client construction
  • ensureBucket: Refactor to use *> for proper effect sequencing across conditional branches

Example

Before:

Async[F].delay {
  val client = builder.build()
  log.info("S3 client created")  // Effect discarded
  client
}

After:

Async[F].delay {
  builder.build()
}.flatTap(client =>
  log.info(s"S3 client created for endpoint: ${config.endpoint}")
)

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI self-assigned this Dec 29, 2025
Use flatTap and *> operators to properly sequence logging effects
instead of discarding them. This ensures logging is actually performed.

Co-authored-by: akreit <64101884+akreit@users.noreply.github.com>
Copilot AI changed the title [WIP] Update to address feedback on cats logger implementation Sequence logging effects in S3Writer using flatTap and *> Dec 29, 2025
Copilot AI requested a review from akreit December 29, 2025 12:28
@akreit akreit closed this Dec 29, 2025
@akreit akreit deleted the copilot/sub-pr-2 branch December 29, 2025 12: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.

2 participants