-
Notifications
You must be signed in to change notification settings - Fork 932
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
What should we do about note comments? #3831
Comments
The way that I would approach this refactoring would be roughly:
|
Sounds like a plan to me... |
There are three pull requests from me that are related to note comments:
|
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
May or may not be a prerequisite for ENT8R/NotesReview#113. Feedback welcome in said issue. |
Agree that @gravitystorm's plan is sensible. (I ended up here looking for a way to vent my frustration at note comments getting hidden when the author is deleted, rendering whole discussion threads utterly meaningless - unlike changeset discussions where contributions by deleted users are kept as being from "user_12345".) One caveat though, currently note comments can be associated with an action - even closing a note without a comment will generate an empty comment as a "vehicle" for the note state change. This will have to be catered for somehow. |
@gravitystorm how would the concept of closing/reopening notes work with this new data model? One way would be…
In addition, we could use the same mechanism to denormalize |
Notes already have a
NoteComments already have an
The API has different endpoints for opening, closing and reopening notes, and the comment needs to be sent to the right one. There is, if you look very closely, a race condition in the code (e.g. checking for whether a note has been closed already is not done with a lock on the note) but in practice that hasn't been a big issue compared to all the other issues with notes.
Yes, we use ActiveJob both for the jobs defined in app/jobs and also for other features like ActionMailer's But for something that is expected to happen instantaneously (e.g. updating a single record in the database) there's generally no need for a queue. Queuing is more useful for things that can take some time (e.g. processing 10,000 Tracepoint records) or interact with external services (e.g. delivering mail). |
removed brain fog |
Why would we need the notes dump? No data has been deleted, the web site is just choosing not to display it. |
I had suspected that the data has not been deleted because it was still in the dump. I'm just gonna keep my hands off that and wait for the process to finish. |
FYI I proposed this refactoring as the next EWG funded project following the bidding processed outlined at https://github.com/osmfoundation/ewg_bidding. The related PR is at osmfoundation/ewg_bidding#9 with the proposed bid text in the files section which will be discussed again during the next EWG Meeting. (Just a reminder, that this text is only the first step which outlines the work to be done (what). The next step will be a bid that outlines the proposed implementation (how) and corresponding estimate.) |
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:
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.
The text was updated successfully, but these errors were encountered: