Skip to content

Simultaneous edits to an issue/PR lead to data loss #22907

Closed
@drsybren

Description

@drsybren

Description

TL;DR: When two people edit an issue/PR description simultaneously, the last one to save "wins".

This scenario is not uncommon:

  • User files a bug report.
  • Developer sees the report, and wants to edit it to clarify some wording or clean up some markdown.
  • User sees a typo, and edits the report.
  • Developer knows the system, so is faster, and saves their edits first.
  • User saves their typo fix
  • Now all the edits done by the developer are reverted by the edit from the user.

This problem is quite serious, because:

  1. There is nothing at all that warns about overwriting someone else's changes.
  2. There are no historical comments "user X changed the description".
  3. There is no way to see the history of description changes.

So not only is there data loss, it remains undetected until someone revisits the page and actually notices their work is gone.

A possible first step could be to use an etag to detect simultaneous edits. Then at least a user can be warned that they'll overwrite someone else's changes.

It would be better to have some way to merge those changes, but that's a whole different issue to solve. I think the most important is to prevent these losses; how to solve such collisions gracefully can be dealt with later.

Gitea Version

00b18ab

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

Self-built from Git.

Database

PostgreSQL

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions