Skip to content

MOBILE-281: Replace deviceUUID with MD5 target hash in monitoring logs - #749

Merged
sergeysozinov merged 2 commits into
developfrom
feature/MOBILE-281
Aug 3, 2026
Merged

MOBILE-281: Replace deviceUUID with MD5 target hash in monitoring logs#749
sergeysozinov merged 2 commits into
developfrom
feature/MOBILE-281

Conversation

@sergeysozinov

Copy link
Copy Markdown
Collaborator

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Updates the monitoring “logs” configuration schema to stop transporting raw deviceUUID values and instead use an MD5 “target” hash, then adjusts filtering/validation and tests/resources accordingly.

Changes:

  • Renamed monitoring log identifier fields from deviceUUID/deviceId to target across DTOs, domain models, mapping, and tests.
  • Updated device matching logic to compare target against MD5(lowercased(deviceUuid)) (case-insensitive target comparison) and added MD5 test vectors.
  • Refreshed config-parsing JSON fixtures and added a fixture/test covering legacy deviceUUID format (parses with target == null).

Reviewed changes

Copilot reviewed 28 out of 28 changed files in this pull request and generated no comments.

Show a summary per file
File Description
sdk/src/test/resources/ConfigParsing/Monitoring/MonitoringLogsTwoElementsTypeError.json Updates monitoring log fixtures to use target instead of deviceUUID.
sdk/src/test/resources/ConfigParsing/Monitoring/MonitoringLogsTwoElementsError.json Updates error-case fixture keys to reflect the new target field.
sdk/src/test/resources/ConfigParsing/Monitoring/MonitoringLogsOneElementTypeError.json Updates monitoring log fixtures to use target.
sdk/src/test/resources/ConfigParsing/Monitoring/MonitoringLogsOneElementError.json Updates monitoring log fixtures to use target.
sdk/src/test/resources/ConfigParsing/Monitoring/MonitoringLogsOldDeviceUuidFormat.json Adds legacy-format fixture with deviceUUID to verify backward parsing behavior.
sdk/src/test/resources/ConfigParsing/Monitoring/MonitoringLogsError.json Updates monitoring error fixture to use target.
sdk/src/test/resources/ConfigParsing/Monitoring/MonitoringLogsElementsMixedError.json Updates mixed-error fixture to use target.
sdk/src/test/resources/ConfigParsing/Monitoring/MonitoringConfig.json Updates baseline monitoring config fixture to use target.
sdk/src/test/resources/ConfigParsing/ConfigWithSettingsABTestsMonitoringInapps.json Updates embedded monitoring fixture to use target.
sdk/src/test/resources/ConfigParsing/Config/ConfigWithSettingsABTestsMonitoringInapps.json Updates embedded monitoring fixture to use target.
sdk/src/test/resources/ConfigParsing/Config/ConfigSettingsTypeError.json Updates embedded monitoring fixture to use target.
sdk/src/test/resources/ConfigParsing/Config/ConfigSettingsError.json Updates embedded monitoring fixture to use target.
sdk/src/test/resources/ConfigParsing/Config/ConfigMonitoringError.json Updates embedded monitoring fixture to use target.
sdk/src/test/resources/ConfigParsing/Config/ConfigInAppsTypeError.json Updates embedded monitoring fixture to use target.
sdk/src/test/resources/ConfigParsing/Config/ConfigInAppsError.json Updates embedded monitoring fixture to use target.
sdk/src/test/resources/ConfigParsing/Config/ConfigABTestsTypeError.json Updates embedded monitoring fixture to use target.
sdk/src/test/resources/ConfigParsing/Config/ConfigABTestsOneElementTypeError.json Updates embedded monitoring fixture to use target.
sdk/src/test/resources/ConfigParsing/Config/ConfigABTestsOneElementError.json Updates embedded monitoring fixture to use target.
sdk/src/test/resources/ConfigParsing/Config/ConfigABTestsError.json Updates embedded monitoring fixture to use target.
sdk/src/test/java/cloud/mindbox/mobile_sdk/monitoring/MonitoringValidatorTest.kt Renames/updates validator tests to cover target instead of deviceId.
sdk/src/test/java/cloud/mindbox/mobile_sdk/monitoring/LogRequestStub.kt Updates stubs to populate target.
sdk/src/test/java/cloud/mindbox/mobile_sdk/monitoring/domain/managers/LogRequestDataManagerImplTest.kt Updates filtering tests for hashed target and adds MD5/edge-case coverage.
sdk/src/test/java/cloud/mindbox/mobile_sdk/inapp/data/managers/serialization/MonitoringMobileConfigSerializationManagerTest.kt Adds legacy-format parsing test and updates expectations/comments for new keys.
sdk/src/main/java/cloud/mindbox/mobile_sdk/monitoring/domain/models/LogRequest.kt Renames domain field from deviceId to target.
sdk/src/main/java/cloud/mindbox/mobile_sdk/monitoring/domain/managers/LogRequestDataManagerImpl.kt Implements MD5 hashing and filters logs by hashed device UUID vs target.
sdk/src/main/java/cloud/mindbox/mobile_sdk/monitoring/data/validators/MonitoringValidator.kt Validates target instead of deviceId.
sdk/src/main/java/cloud/mindbox/mobile_sdk/models/operation/response/InAppConfigResponse.kt Updates monitoring DTOs to deserialize target (nullable in blank DTO).
sdk/src/main/java/cloud/mindbox/mobile_sdk/inapp/data/mapper/InAppMapper.kt Maps DTOs/models using the new target field.

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

import cloud.mindbox.mobile_sdk.repository.MindboxPreferences
import java.security.MessageDigest

internal fun String.md5(): String = MessageDigest.getInstance("MD5")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

А можно тут заиспользовать value class, типо MD5Hash. И будет прикольно.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Посмотри, действительно интересно получилось

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 28 out of 28 changed files in this pull request and generated 1 comment.

val requestId: String,
@SerializedName("deviceUUID")
val deviceId: String,
@SerializedName("target")

@enotniy enotniy Jul 31, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Сериализовать сразу в Md5Hash нельзя?
Или норм, что мы из перехода из Blank делаем

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

В целом можно, через кастомный сериализатор. Но тут скорее не нужно кмк, есть StringStrictAdapter уже и мы в Blank сырые данные храним, в потом маппим после валидации в DTO

@enotniy
enotniy self-requested a review July 31, 2026 15:01
@sergeysozinov
sergeysozinov merged commit 3a09d48 into develop Aug 3, 2026
8 checks passed
@sergeysozinov
sergeysozinov deleted the feature/MOBILE-281 branch August 3, 2026 06:09
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.

3 participants