-
Notifications
You must be signed in to change notification settings - Fork 74
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
RFC: only support a single path layout? #100
Comments
bitfehler
added a commit
to bitfehler/go-webdav
that referenced
this issue
Aug 24, 2022
See emersion#100 for details. Obsoletes emersion#99.
I created #101 to give you some idea of how this would look like. That code is essentially ready for multiple address books, would only require adding the iteration once the backend supports returning multiple. Maybe that can serve as a conversation starter? 🙂 |
bitfehler
added a commit
to bitfehler/go-webdav
that referenced
this issue
Aug 24, 2022
See emersion#100 for details. Obsoletes emersion#99.
bitfehler
added a commit
to bitfehler/go-webdav
that referenced
this issue
Sep 29, 2022
See emersion#100 for details. Obsoletes emersion#99.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
As came up several times, the code keeps getting more and more complicated due to the fact that we support different path layouts (as defined below). The latest example for this is #99. While that PR does a lot of the work already, the complexity of adding features (such as multiple address books might) will always be much higher when accounting for support for all use cases.
I figured it might be wise to take a step back and reiterate how we got here, what problems we are actually trying to solve, and if there is maybe different approach altogether that could ease the pain here.
Let's start with some definitions: WebDAV/CardDAV/CalDAV define a set of paths that serve certain special purposes. We need to consider the following:
go-webdav
only supports a single calendar/address book. This URL has a relation to the calendar/address book home set: it should be underneath it (or at least equal to it), to be discoverable.For brevity, I will from now on only focus on CalDAV, but the same applies of course to CardDAV.
Where we started
Initially, the server was designed in such a way that everything was served at the root path (
/
). The root path was user principal URL, calendar home set, and calendar URL at the same time. The only other URLs involved were the individual resources (events). This works, but has the following drawbacks:/calendar1/
etc./contacts/
and/calendars/
./bitfehler/
or/emersion/
.Current status
Right now, we try to still the support the old case of everything at
/
, and everything in between that and the most extreme opposite, where everything has it's own URL, such as/bitfehler/calendars/work/
, where/bitfehler/
is a user pricipal URL,/bitfehler/calendars/
is the calendar home set, and/bitfehler/calendars/work/
is an actual calendar.Keeping support for everything has caused the regression that #99 tries to fix and leads to all this complicated code where we have to check if something is e.g. also a calendar home set, even though we already know it's a user principal URL.
What now?
Writing all this down, I think my proposal would be to go with the layout that makes everything possible (
/bitfehler/calendars/work/
), but only support that. That should make the code much clearer again, while still allowing to add any feature we might want in the future. It would make writing a backend a tiny bit more work, but I think if all you need is one user and one calendar, hard-coding some names the backend is not too much to ask.If you think this might be a route worth pursuing, I can offer to create a PR for that, to see what the code might look like?
The text was updated successfully, but these errors were encountered: