chibenwa opened a new pull request, #3162: URL: https://github.com/apache/james-project/pull/3162
Follow-up of #3084, reported on linagora/tmail-backend#2621. `DateProperty` resolves its `TZID` lazily in `getValue()`, so an event carrying something like ``` RECURRENCE-ID;TZID=Invalid/Zone:20170111T090000 ``` parses fine (even with `withSuppressInvalidProperties(true)`) but explodes with a `DateTimeException` when `ICALAttributeDTO.Builder.from` reads it. That exception escaped `from(...)`, was caught in `ICALToJsonAttribute.toICAL` as `ERROR Exception while converting calendar to ICAL`, and the **whole calendar was dropped** for that recipient. #3084 guarded `DTSTAMP` only. This PR generalises `safeValue` to any `Property` and routes `optionalOf` through it, so `RECURRENCE-ID` (and `METHOD` / `SEQUENCE`) get the same treatment: the offending field is omitted with a WARN naming the property, and the rest of the calendar is still forwarded. Tests: two new `ICALAttributeDTOTest` cases with fixtures carrying an invalid `TZID` on `DTSTAMP` and on `RECURRENCE-ID`. The `RECURRENCE-ID` one fails on master with `ZoneRulesException: Unknown time-zone ID: Invalid/Zone`. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- *Generated automatically* -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
