Skip to content

[Bug]: GitLab issue timelines lose system events after the first 100 notes #37975

Closed

Description

@StiensWout

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

Not sure

Steps to reproduce

  1. Open Issues for a GitLab project.
  2. Open an issue with at least 100 discussion notes followed by a close event.
  3. Load the remaining comments until there are no more pages.

Expected behavior

The timeline includes the close event alongside the discussion.

Actual behavior

The close event is missing, even after every comment page has been loaded.

Impact

Major degradation or frequent failure. Anyone reading a GitLab issue with more than 100 notes loses later close, reopen, assignment and title-change events every time they open its timeline.

Version or commit

main at 0df1967cfa. The cause is at packages/source-control-gitlab/src/server/GitLabIssueTracker.ts:440.

Environment

Linux x64, the repository's own tests.

Logs or stack traces

the issue timeline must retain the close after note 100
Automated repro

Fails in 2 of 2 runs on main: apply the patch with git apply, then run the command.

--- a/packages/source-control-gitlab/src/server/GitLabIssueTracker.test.ts
+++ b/packages/source-control-gitlab/src/server/GitLabIssueTracker.test.ts
@@ -197,6 +197,49 @@
     }),
   );
 
+  it.effect("keeps system events after the first hundred notes in the issue timeline", () =>
+    Effect.gen(function* () {
+      const firstPage = Array.from({ length: 100 }, (_, index) => ({
+        id: index + 1000,
+        body: "Discussion",
+        author: { username: "julius" },
+        created_at: "2026-07-02T00:00:00Z",
+      }));
+      const api = yield* tracker((args) => {
+        const path = args[1]!;
+        if (path.includes("/notes?")) {
+          const page = new URLSearchParams(path.split("?")[1]).get("page");
+          return encode(
+            page === "1"
+              ? firstPage
+              : page === "2"
+                ? [
+                    {
+                      id: 1100,
+                      body: "closed",
+                      system: true,
+                      author: { username: "theo" },
+                      created_at: "2026-07-03T00:00:00Z",
+                    },
+                  ]
+                : [],
+          );
+        }
+        return answer(path);
+      });
+      const issue = yield* api.getIssue({
+        cwd: "/w",
+        host: "gitlab.com",
+        scope: "acme/web",
+        key: "42",
+      });
+      expect(
+        issue.events,
+        "the issue timeline must retain the close after note 100",
+      ).toContainEqual(expect.objectContaining({ id: "note-1100", kind: "closed" }));
+    }),
+  );
+
   it.effect("pages a listing by GitLab's page number and stops on a short page", () =>
     Effect.gen(function* () {
       const paths: string[] = [];
cd packages/source-control-gitlab && pnpm exec vp test run --config ../../vite.config.ts --dir . src/server/GitLabIssueTracker.test.ts -t "keeps system events after the first hundred notes"

Workaround

No response

Activity

  1. added
    vouch:trusted
    on Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    vouch:trusted

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions