Skip to content

Do not track edits and deletions of pending review comments #18846

Open
@delvh

Description

@delvh

Gitea Version

1.16.1-dev

Git Version

NA

Operating System

Linux

How are you running Gitea?

NA

Database

No response

Can you reproduce the bug on the Gitea demo site?

Yes, unfortunately

Log Gist

No response

Description

Currently, any edit to a comment will be logged in its change history.
For PR Reviews, however, edits should only be logged after the review was submitted.
Edits prior to that should simply be discarded.

Scope

There are two aspects that makes this issue way worse:

  1. The webhooks are also fired, meaning that even though your review is not yet present, others will be informed about the content of what you edited
  2. This does not only apply to editing pending comments, but also to deleting pending comments.

Keep in mind

The creation change should be adapted to not show the original text,
but the text of the last edit before submitting the review.
However, this appears to already be done within models/issues/content_history.go#keepLimitedContentHistory

see https://try.gitea.io/delvh/kanban-test/pulls/16#issuecomment-113571 for example.

Screenshots

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    issue/criticalThis issue should be fixed ASAP. If it is a PR, the PR should be merged ASAPtype/bugtype/proposalThe new feature has not been accepted yet but needs to be discussed first.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions