Skip to content

Display epic related events on user activity feed

Jarka Košanová requested to merge 196835-fix-epic-feed into master

What does this MR do?

It adds displaying epic-related activities on user profile.

The query is now much simpler. The problem with the original query was that it joined projects but we don't have project for epic-related events.

Queries

  • I used myself as the user

Original query

SELECT * FROM (
    SELECT
        "projects".*
    FROM
        "projects"
        INNER JOIN "user_interacted_projects" ON "projects"."id" = "user_interacted_projects"."project_id"
    WHERE
        "user_interacted_projects"."user_id" = 508743) AS projects_for_join
    JOIN (
        SELECT
            "events".*
        FROM
            "events"
        WHERE
            "events"."author_id" = 508743) AS events ON events.project_id = projects_for_join.id
    INNER JOIN "projects" ON "projects"."id" = "events"."project_id"
    LEFT OUTER JOIN "project_features" ON "project_features"."project_id" = "projects"."id"
    LEFT OUTER JOIN "project_import_data" ON "project_import_data"."project_id" = "projects"."id"
    LEFT OUTER JOIN "namespaces" ON "namespaces"."id" = "projects"."namespace_id"
    LEFT OUTER JOIN "users" ON "users"."id" = "events"."author_id"
ORDER BY
    "events"."id" DESC
LIMIT 20

New query

When ordering by created_at

SELECT "events".* FROM "events" WHERE "events"."author_id" = 508743 ORDER BY "events"."created_at" DESC LIMIT 20

when ordering by id (old version)

SELECT "events".* FROM "events" WHERE "events"."author_id" = 508743 ORDER BY "events"."id" DESC LIMIT 20

Screenshots (strongly suggested)

Screenshot_2021-01-26_at_20.41.22

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Related to #196835 (closed)

Edited by Jarka Košanová

Merge request reports

Loading