Skip to content

Commit

Permalink
Revert "Skip changeset discussions unless requested"
Browse files Browse the repository at this point in the history
  • Loading branch information
mmd-osm authored Apr 25, 2024
1 parent ee804f6 commit c9c222c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/backend/apidb/common_pgsql_selection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ void extract_changesets(
for (const auto &row : rows) {
auto elem = extract_changeset(row, cc, changeset_cols);
auto tags = extract_tags(row, tag_cols);
auto comments = (include_changeset_discussions ? extract_comments(row, comments_cols) : comments_t{});
auto comments = extract_comments(row, comments_cols);
elem.comments_count = comments.size();
formatter.write_changeset(
elem, tags, include_changeset_discussions, comments, now);
Expand Down
4 changes: 2 additions & 2 deletions src/backend/apidb/readonly_pgsql_selection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -362,10 +362,10 @@ void readonly_pgsql_selection::write_changesets(output_formatter &formatter,
"to_char(cc.created_at,'YYYY-MM-DD\"T\"HH24:MI:SS\"Z\"') AS created_at "
"FROM changeset_comments cc JOIN users u ON cc.author_id = u.id "
"where cc.changeset_id=c.id AND cc.visible ORDER BY cc.created_at) x "
")cc ON $2 "
")cc ON true "
"WHERE c.id = ANY($1)");

pqxx::result changesets = m.exec_prepared("extract_changesets", sel_changesets, include_changeset_discussions);
pqxx::result changesets = m.exec_prepared("extract_changesets", sel_changesets);

fetch_changesets(sel_changesets, cc);

Expand Down
5 changes: 2 additions & 3 deletions test/test_apidb_backend_changesets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -290,8 +290,7 @@ void check_changeset_with_comments_impl(
REQUIRE(f.m_changesets.size() == 1);

comments_t comments;

if (include_discussion) {
{
changeset_comment_info comment;
comment.id = 1;
comment.author_id = 3;
Expand All @@ -312,7 +311,7 @@ void check_changeset_with_comments_impl(
std::string("user_1"), // display_name
{}, // bounding box
0, // num_changes
include_discussion ? 1 : 0 // comments_count
1 // comments_count
),
tags_t(),
include_discussion,
Expand Down

0 comments on commit c9c222c

Please sign in to comment.