[SYNCOPE-1980] Fix empty audit history diff under Jackson 3#1439
Open
ozimakov wants to merge 1 commit into
Open
[SYNCOPE-1980] Fix empty audit history diff under Jackson 3#1439ozimakov wants to merge 1 commit into
ozimakov wants to merge 1 commit into
Conversation
AuditHistoryDetails.toJSON() deserialized the audited entity with an untyped
MAPPER.reader(), which Jackson 3 rejects with InvalidDefinitionException
("No value type configured for ObjectReader"). The exception was swallowed by
the surrounding catch, so the before/after diff panes always rendered empty.
Read into the concrete type of currentEntity so the reader has a value type.
Member
|
@ozimakov thanks for this fix. One small note: since Syncope 4.0, the local distribution is not based on H2 but embedded PostgreSQL. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SYNCOPE-1980
Problem
In the admin console, the per-entity "Audit History" modal (User / Group / Any Object / Realm / Policy → View Audit History) never renders a JSON diff: both the "previous" and "after" panes are always empty, for any selected versions.
Root cause
AuditHistoryDetails#toJSONdeserializes the audited entity with an untyped reader:Under Jackson 3 an
ObjectReaderwith no configured value type throwsInvalidDefinitionException: No value type configured for ObjectReader. The exception is swallowed by the surroundingtry/catchandtoJSONreturns an emptyModel, so the failure is silent in the UI and only visible in the console log. This is a regression from the Jackson 2 → 3 migration (tools.jackson.*): Jackson 2'smapper.reader()tolerated a missing root type, Jackson 3 requires one.Fix
Read into the concrete type of the entity, which the panel already holds as
currentEntity:The JSON's
_classis then consumed as an ordinary property and the entity deserializes correctly for User/Group/AnyObject/Realm/Policy.Testing
Verified locally against the standalone (H2) distribution: the diff renders and the
InvalidDefinitionExceptionno longer appears in the console log. Full reactor test suite passes.