Can't edit file via single file editor when MR diffs is cached
Summary
When user with edit permissions (e.g. MR author) to a file in a merge request tries to edit a file using single file editor and the diffs was already cached (triggered by a non-authenticated user), the user won't be able to edit the file and will be asked to fork instead.
Steps to reproduce
- Non-authenticated user (guest) views a MR diff. Gets cached.
- Authenticated user who has edit permissions to file (e.g. MR author) views a MR diff and gets cached response.
- Authenticated user tries to edit file in single file-editor. It will say that they have to fork it to edit it because they have no perms.
Example Project
Tested it on https://gitlab.com/patrickbajao/verification when diffs_batch_render_cached
feature flag was turned on.
What is the current bug behavior?
The user can't edit file using single file editor and was being asked to fork.
What is the expected correct behavior?
The user should be able to edit the file since they have permission to do so.