[openstreetmap/openstreetmap-website] What should we do about note comments? (Issue #3831)
Andy Allan
notifications at github.com
Wed Dec 7 18:25:30 UTC 2022
This isn't the first issue on notes and note comments, and I doubt it will be the last either!
The original implementation of notes has, for unimportant reasons, left us with the situation where Notes surprisingly don't have an author or body attribute, but instead every Note has a "first comment" that we treat as special. However, this is not how anyone really thinks of a note - we all think that the note belongs to someone, and has some body text associated with the note itself. The implementation that we have though is as if a note is created out of thin air, with no text and nobody associated to it, whenever someone makes that first comment. This conceptual mismatch, or this leaky abstraction, I think has led to more bugs and errors than any other part of the codebase, and is confusing and also doesn't seem to provide any useful benefits.
There's a whole bunch of open issues and open pull requests that try to fix the various bugs that crop up due to this leaky abstraction. However, many of these are fixing the symptoms one at a time, by making the views or API code more and more complex, rather than trying to fix the underlying model. This has generally made me averse to reviewing and/or merging them, since I think they are going in the wrong direction. I'm aware however that we haven't discussed what the right destination should be!
Personally, I think the long term goal should be to remove the concept of this "special first comment" entirely, and end up with a more straightforward model where we have:
* A Note, which has a body and an author. A note can exist without any comments.
* NoteComments, none of which are "special" and each can be individually added, removed, hidden etc without affecting the validity of the Note.
This would align note comments with our other comment models, for example changeset comments and diary comments. We don't implement diary entries by having a blank DiaryEntry and a special first DiaryComment containing the text of the diary entry!
If we are all agreed on the destination, then we can start planning out the refactoring required to get there. This will also help assess the existing pull requests and open issues on this topic.
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/issues/3831
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/issues/3831 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20221207/615eb639/attachment.htm>
More information about the rails-dev
mailing list