From 01c555f8db85339060b53446caa7ada9121b475f Mon Sep 17 00:00:00 2001 From: Martin Lowe <martin.lowe@eclipse-foundation.org> Date: Tue, 11 Mar 2025 12:53:11 -0400 Subject: [PATCH] fix: address infinite recursion in EfUser serialization The new helper method to get the public facing model of a user object was being called during serialization, and since it returns a copy of itself, it created a crash loop. Adding JSONIgnore forces the method to be ignored which resolves the issue. --- .../org/eclipsefoundation/efservices/api/models/EfUser.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/efservices/src/main/java/org/eclipsefoundation/efservices/api/models/EfUser.java b/efservices/src/main/java/org/eclipsefoundation/efservices/api/models/EfUser.java index 6c4a91bc..e4561581 100644 --- a/efservices/src/main/java/org/eclipsefoundation/efservices/api/models/EfUser.java +++ b/efservices/src/main/java/org/eclipsefoundation/efservices/api/models/EfUser.java @@ -70,10 +70,12 @@ public record EfUser(String uid, String name, String picture, String mail, Eca e } /** - * Converts the user profile to the restricted public view. + * Converts the user profile to the restricted public view. Json Ignore is super important, as otherwise this will recursively add + * itself to json and crash. * * @return current user profile, with the private data blanked out. */ + @JsonIgnore public EfUser getPublicProfile() { return EfUserBuilder .builder(this) -- GitLab