Skip to content

Create comment fails with error : empty line_code #128

@aravind2612krishna

Description

@aravind2612krishna

Bug Description

The create comment request returns the following response
{"message":"400 Bad request - Note {:line_code=>[\"can't be blank\", \"must be a valid line code\"]}"}
The request body is as follows:

{
  "body": "```suggestion:-4+0\n                redactedcode\n                    redactedcode-\u003eDestroy();\n\n                if (redactedcode)\n                    redactedcode-\u003eDestroy();\n```\n\nredactedcomment",
  "position": {
    "base_sha": "a2610248747681941279bd033169980fefd25732",
    "head_sha": "d08978d3d18fdfbd9945952d58c50507dc6a23ed",
    "start_sha": "a2610248747681941279bd033169980fefd25732",
    "new_path": "redactedfile",
    "old_path": "redactedfile",
    "position_type": "text",
    "new_line": 1659,
    "old_line": 1979,
    "line_range": {
      "start": {
        "line_code": "ecaaaac4a1a5cb79b55c2e7bf498f9e3847f87d0_1975_1655",
        "type": "new"
      },
      "end": {
        "line_code": "ecaaaac4a1a5cb79b55c2e7bf498f9e3847f87d0_1979_1659",
        "type": "new"
      }
    }
  }
}

Reproduction Steps

call to create_comment(), create_multiline_comment() or create_comment_suggestion(),
It is not rare, some times it works.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions