[go: up one dir, main page]

Skip to content

Fix incorrect HTML response status code for single-page edit

This issue fixed an incorrect status code for editing a single page. However, we found that the controller endpoint still returns status 200 with an HTML response in some cases, causing the frontend to fall back to a generic error message. While the controller endpoints will eventually be replaced with the public REST API, we should fix the incorrect status code for now so the frontend can properly handle the error case.

Reference: #509968 (comment 2382749014)

Screenshot_2025-03-11_at_8.30.24_pm

How to reproduce it

  1. Login with two different users on two separate browsers.Both two users should be able to edit the file using "Edit single File"
  2. Try to edit the same file simultaneously with the two different users
  3. They both should push to the same branch, for example main.
  4. Inspect the response, notice it is an HTML response

Requirements

in !174287 (d989e400), we temporarily update the error message in spec/features/projects/files/editing_a_file_spec.rb to be a generic one. this should be reverted, after the change here.

Edited by Emma Park