Merge Request Approved event Webhook payload contains old updated_at

Summary

Webhook payload data for Merge Request Approved events contain an incorrect updated_at field in the object_attributes. It seems that the updated_at timestamp is updated in the MergeRequest model record after the Webhook is sent.

A customer engaged Support regarding this behaviour. ZenDesk ticket refers (internal). They expect the updated_at timestamp in the Webhook payload to contain the timestamp resulting from the approval action.

Example timings from my testing:

Webhook received: 2023-06-07 05:14:11 UTC
Webhook payload updated_at: 2023-06-07 05:08:09 UTC
Rails Model updated_at: 2023-06-07 05:14:11.244585000 UTC +00:001

Steps to reproduce

  1. Setup a Webhook for Merge Request events
  2. Create a new branch
  3. Create an MR for the new branch
  4. Wait 60s
  5. Add a file/change to the source branch. Confirm updated_at in Webhook payload is the same as updated_at in the MergeRequest model record
  6. Wait 60s
  7. Add a Reviewer to the MR. Confirm updated_at in Webhook payload is the same as updated_at in the MergeRequest model record
  8. Wait 60s
  9. Approve the MR. updated_at in the Webhook payload is not the same as updated_at in the MergeRequest model record
  10. Wait 60s
  11. Unapprove the MR. Confirm updated_at in Webhook payload is the same as updated_at in the MergeRequest model record

Example Project

What is the current bug behavior?

The Webhook for Merge Request Approved action event contains the updated_at timestamp from before the approval. This is not consistent with other actions and their Webhook payloads.

What is the expected correct behavior?

The updated_at for each action should ideally contain the timestamp of the update corresponding to the action

Relevant logs and/or screenshots

Output of checks

Results of GitLab environment info

Expand for output related to GitLab environment info

(For installations with omnibus-gitlab package run and paste the output of:
`sudo gitlab-rake gitlab:env:info`)

(For installations from source run and paste the output of:
`sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production`)

Results of GitLab application Check

Expand for output related to the GitLab application check

(For installations with omnibus-gitlab package run and paste the output of: sudo gitlab-rake gitlab:check SANITIZE=true)

(For installations from source run and paste the output of: sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true)

(we will only investigate if the tests are passing)

Possible fixes

Edited Jan 14, 2026 by 🤖 GitLab Bot 🤖
Assignee Loading
Time tracking Loading