Skip to content

Log full filename instead of just last char#1404

Merged
BurningAXE merged 1 commit into
release/2025.3.0from
bugfix/log-full-sample-filename
Oct 13, 2025
Merged

Log full filename instead of just last char#1404
BurningAXE merged 1 commit into
release/2025.3.0from
bugfix/log-full-sample-filename

Conversation

@BurningAXE
Copy link
Copy Markdown
Contributor

@BurningAXE BurningAXE commented Oct 13, 2025

JIRA ticket
Will be released in: 2025.3.0

Root cause analysis (for bugfixes only)

First known affected version: 2025.3.0-dev

  • Currently logs only last character of filename

Notable changes

  • Logs full filename

Testing guidance

  • Describe how the reviewers can verify that issue is fixed

Additional work checklist

  • Effect on other features and security has been considered
  • Design document marked as "In development" (if applicable)
  • External (Gitbook) and internal (Confluence) Documentation is up to date (or ticket created)
  • Test cases in Testiny are up to date (or ticket created)
  • Other teams notified about the changes (if applicable)

@cla-bot cla-bot Bot added the ... label Oct 13, 2025
@BurningAXE BurningAXE requested review from a team, TristramN, alex-vt, alexandr-simprints, Copilot, luhmirin-s, meladRaouf and ybourgery and removed request for a team October 13, 2025 15:45
Copy link
Copy Markdown

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 PR fixes a logging issue where only the last character of the filename was being logged instead of the full filename during image uploads.

  • Changed logging to use the full filename from the relative path instead of just the last character
  • Improved debugging visibility by showing complete filenames in upload logs

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

.fold(rootRef) { ref, pathPart -> ref.child(pathPart) }

Simber.i("Uploading ${fileRef.path.last()}", tag = SAMPLE_UPLOAD)
Simber.i("Uploading ${imageRef.relativePath.parts.last()}", tag = SAMPLE_UPLOAD)
Copy link

Copilot AI Oct 13, 2025

Choose a reason for hiding this comment

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

The fix assumes imageRef.relativePath.parts is non-empty, but if the list is empty, last() will throw a NoSuchElementException. Consider using lastOrNull() or adding a null check to prevent runtime crashes.

Suggested change
Simber.i("Uploading ${imageRef.relativePath.parts.last()}", tag = SAMPLE_UPLOAD)
Simber.i("Uploading ${imageRef.relativePath.parts.lastOrNull() ?: "<unknown>"}", tag = SAMPLE_UPLOAD)

Copilot uses AI. Check for mistakes.
@BurningAXE BurningAXE force-pushed the bugfix/log-full-sample-filename branch from b1cf110 to 24e48f8 Compare October 13, 2025 15:57
@sonarqubecloud
Copy link
Copy Markdown

@BurningAXE BurningAXE merged commit 9bda1a7 into release/2025.3.0 Oct 13, 2025
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants