Skip to content

refactor: polish logs helpers#969

Open
ovitrif wants to merge 3 commits into
masterfrom
refactor/logs-polish
Open

refactor: polish logs helpers#969
ovitrif wants to merge 3 commits into
masterfrom
refactor/logs-polish

Conversation

@ovitrif
Copy link
Copy Markdown
Collaborator

@ovitrif ovitrif commented May 25, 2026

Fixes #963

This PR:

  1. Ports the missed support-log archive name polish from local fix/logs-spam-and-size, so support uploads use the archive base name while local sharing keeps the .zip file name.
  2. Extracts log parsing, ZIP creation, writable log selection, and retention pruning into focused internal helpers.
  3. Adds unit coverage for the log refactor suggestions from Refactor logs logic #963: filename parsing, ZIP trimming, part-file selection, and retention eviction.

Description

The support-log flow now separates upload archive naming from local ZIP file naming, avoiding repeated .zip suffix handling while keeping the local share file explicit.

The refactor keeps the production flow behavior in LogsRepo and LogSaverImpl, but moves the small pure pieces into testable helpers. That gives the log retention and ZIP-trimming behavior direct coverage without needing full repository or logger lifecycle setup.

Preview

N/A

QA Notes

Manual Tests

N/A

Automated Checks

  • Unit tests added: cover log file display parsing, archive filename normalization, ZIP trimming, and empty-log snapshot retention in app/src/test/java/to/bitkit/repositories/LogsRepoTest.kt.
  • Unit tests added: cover writable log part selection and age/size retention pruning while preserving the active file in app/src/test/java/to/bitkit/utils/LogSaverImplTest.kt.
  • Ran locally: ./gradlew compileDevDebugKotlin.
  • Ran locally: ./gradlew testDevDebugUnitTest.
  • Ran locally: ./gradlew detekt.
  • Ran locally: git diff --check origin/master...HEAD.

@ovitrif ovitrif added this to the 2.3.0 milestone May 25, 2026
@ovitrif ovitrif self-assigned this May 25, 2026
@ovitrif ovitrif marked this pull request as ready for review May 25, 2026 23:43
@ovitrif ovitrif requested a review from jvsena42 May 25, 2026 23: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.

Refactor logs logic

1 participant