unloggedio / unlogged-sdk

Unlogged SDK for recording JAVA code execution
https://unlogged.io
Apache License 2.0
179 stars 16 forks source link

SDK uses jackson annotation from shaded jar instead of main package #109

Closed kartikeytewari-ul closed 1 month ago

kartikeytewari-ul commented 2 months ago

Describe the bug

The SDK uses jackson for serialisation and deserialisation. The sdk's jackson enforces the user to use annotation from unlogged sdk in there project like selogger.com.fasterxml.jackson.annotation instead of using the annotation from main jackson package like com.fasterxml.jackson.annotation.

This forces the user to modify the code base in few places for the SDK to work properly.

Reproduction steps

Project: unlogged-spring-maven-demo Class: SessionExceptions Pojo: Department and Employee

Expected behaviour

The SDK should use the annotation of main jackson package.

kartikeytewari-ul commented 2 months ago

RCA:

Proposed fix:

  1. findReferenceType can be modified to check for both classes inside selogger and in main jackson package.
  2. _findAnnotation is the downstream call from all methods including findReferenceType to check presence of annotation. This can be modified to check annotations inside and outside of selogger package.
kartikeytewari-ul commented 2 months ago

This is resolved in PR #110