Skip to content

Conversation

@ArnyminerZ
Copy link
Member

@ArnyminerZ ArnyminerZ commented Nov 11, 2025

  • Uses HttpHeaders from ktor everywhere
  • Added a warning in the README about the migration to ktor

@ArnyminerZ ArnyminerZ linked an issue Nov 11, 2025 that may be closed by this pull request
@ArnyminerZ ArnyminerZ self-assigned this Nov 11, 2025
@ArnyminerZ ArnyminerZ added the refactoring Internal improvement of existing functions label Nov 11, 2025
@ArnyminerZ ArnyminerZ marked this pull request as ready for review November 11, 2025 12:13
@ArnyminerZ ArnyminerZ requested a review from rfc2822 November 11, 2025 12:13
Copy link
Member

@rfc2822 rfc2822 left a comment

Choose a reason for hiding this comment

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

I'm not a fan of having a manually maintained annotation for Ktor dependencies. It looks error-prone and if we just forget a single thing (or forget to not use such annotated methods in DAVx5 code), everything breaks.

So considering that we want to transition to Ktor anyway, I think we can keep the ktor code for simplicity and just not exclude the ktor library in DAVx5.

And then hopefully make progress to move everything to ktor …

@ArnyminerZ
Copy link
Member Author

I'm not a fan of having a manually maintained annotation for Ktor dependencies. It looks error-prone and if we just forget a single thing (or forget to not use such annotated methods in DAVx5 code), everything breaks.

Maybe we just specify it in the comments? To be sure. Because with other functions it's clear (for example, they use a ktor reference in the arguments), but for others (such as they use ContentType), it's not clear from the caller side.

@rfc2822
Copy link
Member

rfc2822 commented Nov 12, 2025

Maybe we just specify it in the comments? To be sure. Because with other functions it's clear (for example, they use a ktor reference in the arguments), but for others (such as they use ContentType), it's not clear from the caller side.

However we'd then have to remove it again when we drop okhttp …

I think we should keep ktor usage in common code as little as possible, but it's acceptable. We just need to know that Ktor must not be excluded in gradle.

So maybe mention that in the README? That dav4jvm is currently in a rewrite phase to Ktor and that ktor must not be excluded. We can then update it when we remove okhttp from the dependencies.

Signed-off-by: Arnau Mora <arnyminerz@proton.me>
Signed-off-by: Arnau Mora <arnyminerz@proton.me>
Signed-off-by: Arnau Mora <arnyminerz@proton.me>
@ArnyminerZ
Copy link
Member Author

I've updated everything, and added a note to the README. Maybe the title of the PR should be updated now

Copy link
Member

@rfc2822 rfc2822 left a comment

Choose a reason for hiding this comment

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

I have added a comment to the Ktor issue: #72 (comment)

@rfc2822
Copy link
Member

rfc2822 commented Nov 17, 2025

We can also really remove the "requires Ktor" because the Ktor dependency is necessary anyway.

Signed-off-by: Arnau Mora <arnyminerz@proton.me>
Signed-off-by: Arnau Mora <arnyminerz@proton.me>
@ArnyminerZ
Copy link
Member Author

Well, this PR has been simplified a lot, if not unnecessary. However, I still think the changes are important

@ArnyminerZ ArnyminerZ changed the title [bis] Fix misimport of ktor variable in common module Use ktor's HttpHeaders everywhere, and add warning about ktor-okhttp in README Nov 17, 2025
@ArnyminerZ ArnyminerZ requested a review from rfc2822 November 17, 2025 09:56
@ArnyminerZ ArnyminerZ merged commit 0979bd7 into main Nov 17, 2025
5 checks passed
@ArnyminerZ ArnyminerZ deleted the 109-bis-fix-misimport-of-ktor-variable-in-common-module branch November 17, 2025 11:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactoring Internal improvement of existing functions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

okhttp packages can't be used without ktor

2 participants