-
Notifications
You must be signed in to change notification settings - Fork 27
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
base: master
Are you sure you want to change the base?
Conversation
tmail-backend/apps/memory/src/main/java/com/linagora/tmail/james/app/MemoryServer.java
Show resolved
Hide resolved
...end/tmail-third-party/openpaas/src/main/java/com/linagora/tmail/dav/card/CardDavHandler.java
Outdated
Show resolved
Hide resolved
5dc96d3
to
0df173e
Compare
tmail-backend/tmail-third-party/openpaas/src/main/java/com/linagora/tmail/dav/DavClient.java
Outdated
Show resolved
Hide resolved
tmail-backend/tmail-third-party/openpaas/src/main/java/com/linagora/tmail/dav/DavClient.java
Outdated
Show resolved
Hide resolved
tmail-backend/tmail-third-party/openpaas/src/main/java/com/linagora/tmail/dav/DavClient.java
Outdated
Show resolved
Hide resolved
tmail-backend/tmail-third-party/openpaas/src/main/java/com/linagora/tmail/dav/DavClient.java
Outdated
Show resolved
Hide resolved
tmail-backend/tmail-third-party/openpaas/src/main/java/com/linagora/tmail/dav/DavClient.java
Outdated
Show resolved
Hide resolved
...y/openpaas/src/main/java/com/linagora/tmail/dav/request/GetCalendarByEventIdRequestBody.java
Outdated
Show resolved
Hide resolved
...ackend/tmail-third-party/openpaas/src/main/java/com/linagora/tmail/dav/xml/CalendarData.java
Outdated
Show resolved
Hide resolved
tmail-backend/tmail-third-party/openpaas/src/main/java/com/linagora/tmail/dav/DavClient.java
Outdated
Show resolved
Hide resolved
...il-third-party/openpaas/src/main/java/com/linagora/tmail/configuration/DavConfiguration.java
Outdated
Show resolved
Hide resolved
tmail-backend/tmail-third-party/openpaas/src/main/java/com/linagora/tmail/dav/DavClient.java
Outdated
Show resolved
Hide resolved
tmail-backend/tmail-third-party/openpaas/src/main/java/com/linagora/tmail/dav/DavClient.java
Outdated
Show resolved
Hide resolved
7c99cbe
to
c448e55
Compare
Note: For some reason, I had to force push. Anyway, the only new commit is c448e55. |
tmail-backend/tmail-third-party/openpaas/src/main/java/com/linagora/tmail/dav/DavClient.java
Outdated
Show resolved
Hide resolved
...kend/tmail-third-party/openpaas/src/test/java/com/linagora/tmail/dav/DavServerExtension.java
Outdated
Show resolved
Hide resolved
tmail-backend/tmail-third-party/openpaas/src/main/java/com/linagora/tmail/dav/DavClient.java
Outdated
Show resolved
Hide resolved
.switchIfEmpty(Mono.fromRunnable( | ||
() -> LOGGER.trace("VEvent '{}' was not found in Calendar '{}'.", eventUid, calendarURI))) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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>.
There was a problem hiding this comment.
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)
???
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://projectreactor.io/docs/core/release/api/reactor/util/context/Context.html
Yes but it looses context. So please comply.
There was a problem hiding this comment.
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?
tmail-backend/tmail-third-party/openpaas/src/main/java/com/linagora/tmail/dav/DavClient.java
Outdated
Show resolved
Hide resolved
To be adopted at the James scale if needed. Feel free to post an email about this onto |
@HoussemNasri you need to rebase in order to solve conflict |
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.... |
Reviewed. There is still a merge conflict over here! |
b70ba7e
to
a0ab5f9
Compare
Can we write a clean history here with |
tmail-backend/tmail-third-party/openpaas/src/main/java/com/linagora/tmail/dav/DavClient.java
Outdated
Show resolved
Hide resolved
...kend/tmail-third-party/openpaas/src/main/java/com/linagora/tmail/dav/DavClientException.java
Outdated
Show resolved
Hide resolved
… 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.
f21f149
to
ced7adc
Compare
<dependency> | ||
<groupId>org.wiremock</groupId> | ||
<artifactId>wiremock-standalone</artifactId> | ||
<version>3.10.0</version> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Forgotten <scope>test</scope>
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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> |
There was a problem hiding this comment.
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)
tmail-backend/tmail-third-party/openpaas/src/main/java/com/linagora/tmail/dav/DavClient.java
Outdated
Show resolved
Hide resolved
tmail-backend/tmail-third-party/openpaas/src/main/java/com/linagora/tmail/dav/DavClient.java
Outdated
Show resolved
Hide resolved
[ERROR] Crashed tests: |
Closes #1462
TODO:
If-Match
header not to update calendar objects that changed since they have been retrieved.