-
Notifications
You must be signed in to change notification settings - Fork 107
Compatibility workaround: Accept XML content from calendar server even if it's marked up with content-type text/plain #465
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
Compatibility workaround: Accept XML content from calendar server even if it's marked up with content-type text/plain #465
Conversation
|
I feel that every time this part of the code is touched, someone with a weird server setup raises some issue complaining that the new changes breaks things in their end, so I should look carefully into it before pressing the merge-button. |
|
That is why I proposed #451 (comment) Then, they can record it when it works and you can test it. |
|
Most end-users of the caldav library are not direct users. I believe the HomeAssistant caldav integration is the biggest contribution of end-users. Although quite a lot of HA-users are technically competent, it's not possible to ask all of them to run it ... so for every release, it's important to do as much as possible to ensure compatibility. And then of course it's important to have a stand-alone server checker tool, so that when end-users are having problems, they can run the said tool. |
|
I generally agree to the TTD-concept (though I've seen it taken too far - program split into too many internal/private methods/functions, all of them having unit tests - meaning that most refactoring efforts would breaks lots of unit tests, but I digress). It's easy and sometimes even fun to write unit tests for purely logical functions that takes some input and should provide some output. When it comes to communication with databases and communication between different components in a layered architecture it becomes more complicated - but the caldav library is even worse, it's used for communication with arbitrary third-parties that may behave in erratic ways. I believe the way to handle this is through functional tests - and I've written up quite a lot of them for the caldav project. If I could run the functional test towards all possible server implementations that exists out there for every release, it would be ultra-safe to do refactoring work :-) I do have a list of servers that I test towards for every release, but it's a lot of work to maintain it, and it involves quite some time and effort to run the tests towards all the servers, hence the releases for the caldav library comes a lot slower than the releases for the recurring ical library :-) |
|
Thank you for letting me know all this! |
|
Some thoughts:
|
|
So I'd like to see those two changes:
I can fix this myself, but I think it's cleaner with one commit from one author for one logical changeset :-) |
ce1fef5 to
4335f8c
Compare
|
@tobixen, cool, you did some changes... What would you like me to do still? Is it ok for you this way? |
|
I think it's done |
|
Oh, it would have been nice to squash the commits and make a better commit entry |
|
This has a side effect, the errors shown from the caldav client are horrible if the server delivers a 500-error or similar. I will have to work a bit more on it. |
* Moved the server compatibility database from test directory to the caldav directory. This is needed for #402 and for my caldav-server-tester script. * Now that the caldav-server-tester script has been moved into a separate project, I still need it to access my test calendar configuration. Made a temp hack for this, will work more on it later. * While working at the above, I made #485 and started preparing a bit for it. * piggybacking in a fix for #465 (comment)
|
Please let me know when you plan to do your integration tests with the other servers. I would like to have a look. |
|
I've already started. I'd like to do a 1.5-release with what I have now, and then possibly do a payment request (I've had the possibility to work quite a bit over the last few days). There are some regressions that have sneaked in, working to fix it in #492 |
* Moved the server compatibility database from test directory to the caldav directory. This is needed for #402 and for my caldav-server-tester script. * Now that the caldav-server-tester script has been moved into a separate project, I still need it to access my test calendar configuration. Made a temp hack for this, will work more on it later. * While working at the above, I made #485 and started preparing a bit for it. * piggybacking in a fix for #465 (comment)
* Moved the server compatibility database from test directory to the caldav directory. This is needed for python-caldav#402 and for my caldav-server-tester script. * Now that the caldav-server-tester script has been moved into a separate project, I still need it to access my test calendar configuration. Made a temp hack for this, will work more on it later. * While working at the above, I made python-caldav#485 and started preparing a bit for it. * piggybacking in a fix for python-caldav#465 (comment)
When testing with the caldav library, I noticed that just in my tests, the content type got altered.
So, I was debugging for 2 hours in this lib and found that in case of text/plain, the content does not get used.
Then, I read through it and saw you wanted to refactor that anyway. So, here is my attempt at that.
Change:
Related: