Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide an API to interact with CalDav server #1465

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

HoussemNasri
Copy link
Member

@HoussemNasri HoussemNasri commented Jan 15, 2025

Closes #1462

TODO:

  • Use the If-Match header not to update calendar objects that changed since they have been retrieved.

@HoussemNasri
Copy link
Member Author

Note: For some reason, I had to force push. Anyway, the only new commit is c448e55.

@HoussemNasri HoussemNasri marked this pull request as ready for review January 24, 2025 13:24
Comment on lines 162 to 230
.switchIfEmpty(Mono.fromRunnable(
() -> LOGGER.trace("VEvent '{}' was not found in Calendar '{}'.", eventUid, calendarURI)))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ReactorUtils.logAsMono in order to be more idiomatic.

Copy link
Member Author

@HoussemNasri HoussemNasri Jan 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldn't because logAsMono is not generic. It returns Mono<Void> while we need Mono<Calendar>.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ReactorUtils.logAsMono(() -> LOGGER...).thenReturn(calendar) ???

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But then we need to thenReturn(null). In my opinion, unless we make logAsMono generic, this is the best syntax we can achieve.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, done. Should we open a PR in James to make logAsMono generic?

@chibenwa
Copy link
Member

An alternative solution is we use this fork https://github.com/nmondal/spark-11/blob/master/pom.xml

To be adopted at the James scale if needed. Feel free to post an email about this onto [email protected].

@chibenwa
Copy link
Member

@HoussemNasri you need to rebase in order to solve conflict

@chibenwa
Copy link
Member

Use the If-Match header not to update calendar objects that changed since they have been retrieved.

Basic rule when doing optimistic transactions:

This will need to be retried.

THe total number of retries need to be bounded and low: 5 max....

@chibenwa
Copy link
Member

Reviewed.

There is still a merge conflict over here!

@chibenwa
Copy link
Member

Can we write a clean history here with ISSUE-XXX as a commit message prefix?

… operations

- Implemented parsing of DAV multistatus responses
- Implemented user calendar discovery via PROPFIND requests
- Added WireMock for testing PROPFIND and REPORT methods as mockserver does not support custom HTTP methods.
<dependency>
<groupId>org.wiremock</groupId>
<artifactId>wiremock-standalone</artifactId>
<version>3.10.0</version>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Forgotten <scope>test</scope>

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to summarize the current issue with dependencies:

  • Wiremock imports a library called json-schema-validator.
  • This library is being imported by mockserver too but uses an old and uncompatible version.
  • At class-load time, this library reads a localization JSON file, parses it, and caches the object in memory.
  • This file is not stored under a package name but rather stored in the root of the resources folder.
  • This creates a conflict between the two localization files imported by Wiremock and Mockserver and one would override the other.
  • As the versions of the library imported are incompatible, using the code of version A to read the config of version B fails.
  • The two versions can co-exist because the wiremock library is imported as standalone: https://github.com/wiremock/wiremock/blob/f91326573547a90fd143252d77961eaa0345dbb1/build.gradle#L284

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok shading dependencies is really OK in this context.

<dependency>
<groupId>org.mnode.ical4j</groupId>
<artifactId>ical4j</artifactId>
<version>3.2.9</version>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Count on me for forgetting to update the dependency, resulting in a delta, and non-previsible behaviour because of non allignement with Apache James.

We should:

  • Add ical4j in james project management and use it within the scope of Apache James projects
  • And then remove specific versions of Tmail so that we align with James BOM (bill of material)

@Arsnael
Copy link
Member

Arsnael commented Feb 3, 2025

[ERROR] Crashed tests:
[ERROR] com.linagora.tmail.james.app.MemoryServerWithOpenPaasConfiguredTest$DavConfigured

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Provide an API to interact with CalDav server
3 participants