fix: issues found in the invitations live check

- guest list failed when no guest was linked yet (Map.of().get(null))
- counter errors arrive as ProblemDetail: read the reason code from detail;
  drop the counter error advice the core handler always overrode
- emails published with a null sender failed the NOT NULL column

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EFUzfj5akPxyikzGc2iAHM
This commit is contained in:
ngqileandClaude Opus 5.5 committed 2026-12-01 17:27:22 +08:00
1 parent aed9473aba
commit fbbc5d0980
10 files changed
+115 -87

No files matched your search

@@ -278,7 +278,9 @@ public class AdminEventService {
private static String counterField(HttpClientErrorException e, String field, String fallback) {
try {
String v = new ObjectMapper().readTree(e.getResponseBodyAsString()).path(field).asText();
// The counter's core error handler sends a ProblemDetail whose "detail" is the reason code.
com.fasterxml.jackson.databind.JsonNode body = new ObjectMapper().readTree(e.getResponseBodyAsString());
String v = body.path(field).asText("code".equals(field) ? body.path("detail").asText() : "");
return v.isEmpty() ? fallback : v;
} catch (Exception ex) {
return fallback;
@@ -184,7 +184,9 @@ public class PublicInviteService {
private static String counterCode(HttpClientErrorException e) {
try {
String v = new ObjectMapper().readTree(e.getResponseBodyAsString()).path("code").asText();
// The counter's core error handler sends a ProblemDetail whose "detail" is the reason code.
com.fasterxml.jackson.databind.JsonNode body = new ObjectMapper().readTree(e.getResponseBodyAsString());
String v = body.path("code").asText(body.path("detail").asText());
return v.isEmpty() ? "CONFLICT" : v;
} catch (Exception ex) {
return "CONFLICT";