Skip to content

[MS-1076] Fix: SID is not handling the enrolment record events when there is the metadata field#1275

Merged
alexandr-simprints merged 6 commits into
release/2025.2.0from
MS-1076-sid-is-not-handling-the-enrolment-record-events-when-there-is-the-metadata-field
Jul 22, 2025
Merged

[MS-1076] Fix: SID is not handling the enrolment record events when there is the metadata field#1275
alexandr-simprints merged 6 commits into
release/2025.2.0from
MS-1076-sid-is-not-handling-the-enrolment-record-events-when-there-is-the-metadata-field

Conversation

@alexandr-simprints
Copy link
Copy Markdown
Contributor

@alexandr-simprints alexandr-simprints commented Jul 21, 2025

JIRA ticket
Will be released in: 2025.2.0

Root cause analysis (for bugfixes only)

Jackson attempted to resolve the subtype for the metadata field. Because this field is within a polymorphic class (ApiBiometricReference), deserialization failed with a missing type error.

First known affected version: 2025.2.0 (testing phase)

  • Describe how the issue was found and what causes it
    Could not resolve subtype of [map type; class java.util.HashMap, [simple type, class java.lang.String] -> [simple type, class java.lang.String]]: missing type id property 'type' (for POJO property 'metadata')
    It is caused by the Jackson library applying polymorphic deserialization to the metadata field. This property is inherited from a base class using a @JsonTypeInfo annotation.
    Note: added comments to change the implementation to the one suggested here: Add new OptBoolean valued property in @JsonTypeInfo, handling, to allow per-polymorphic type loose Type Id handling FasterXML/jackson-databind#3877 (comment)
    Current MinSDK prevents us from updating Jackson, hence the current implementation with explicit annotation in the subclasses

Testing guidance

  • Describe how the reviewers can verify that issue is fixed
    Use dev environment, and login into the m0Zk7c28tbpMkdTcIBm8 project. This project contains the 8eaee786-f749-4059-872a-9fc3ff454c42 event, containing the metadate, and it should be parsed correctly (keep an eye on logs, as the crash doesn't stop the application from running)

Additional work checklist

  • Effect on other features and security has been considered

…025.2.0

# Conflicts:
#	infra/event-sync/src/main/java/com/simprints/infra/eventsync/event/remote/models/callout/ApiConfirmationCallout.kt
#	infra/events/src/main/java/com/simprints/infra/events/event/domain/models/callout/ConfirmationCalloutEvent.kt
…ype. Adding `@JsonTypeInfo(use = JsonTypeInfo.Id.NONE)` annotation to the metadata field to prevent Jackson from treating the `metadata` field as polymorphic.
…erageReports annotation to exclude from Sonar test coverage
val templates: List<ApiFaceTemplate>,
val format: String,
// [MS-1076] The parent 'ApiBiometricReference' class should have its JsonSubTypes annotation updated to
// @JsonSubTypes.Type([...], looseHandling = true) once we update to SDK => 25 and Jackson => 2.16.0.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

once we update to SDK => 25

if :D

…tCoverageReports annotation to exclude from Sonar test coverage
@sonarqubecloud
Copy link
Copy Markdown

@alexandr-simprints alexandr-simprints merged commit e0165f6 into release/2025.2.0 Jul 22, 2025
12 checks passed
@alexandr-simprints alexandr-simprints deleted the MS-1076-sid-is-not-handling-the-enrolment-record-events-when-there-is-the-metadata-field branch July 22, 2025 06:46
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.

3 participants