Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect nested webUI when submitting an empty inline review within a PR #18151

Closed
eeyrjmr opened this issue Jan 1, 2022 · 12 comments · Fixed by #18156
Closed

Incorrect nested webUI when submitting an empty inline review within a PR #18151

eeyrjmr opened this issue Jan 1, 2022 · 12 comments · Fixed by #18156
Labels
issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented type/bug

Comments

@eeyrjmr
Copy link
Contributor

eeyrjmr commented Jan 1, 2022

Gitea Version

1.15.8/1.16

Can you reproduce the bug on the Gitea demo site?

Yes

Description

When you start a review associated with a PR, if you select a line-number and "start review" the vast majority of the Gitea WebUI is reproduced causing layout issues. The key point is "submitting an empty comment" (or trigger some other errors).

https://try.gitea.io/eeyrjmr/test_issues/pulls/2/files

Steps to reproduce

  1. Start a PR
  2. view PR
  3. View PR files
  4. click blue + on one of the lines
  5. keep content empty, click green start review UI button
  6. error message: "Content cannot be empty."

2022-01-01_18-01-1641060192

@Gusted
Copy link
Contributor

Gusted commented Jan 1, 2022

This of course shouldn't be happening, I know that this HTML(the review panel) is provided and rendered from a network request on-demand. So... do you have any extension, proxies, firewall that could cause interference.

@eeyrjmr
Copy link
Contributor Author

eeyrjmr commented Jan 1, 2022

I do have some extensions so I'll retry with all disabled to see if it can be narrowed down

@eeyrjmr
Copy link
Contributor Author

eeyrjmr commented Jan 2, 2022

so...
Chrome-98 and used incognito mode - issue exists
Chrome-98 and all extensions disabled - issue exists
Firefox-95 - issue exists

No proxy in use. and firewall was disabled to test, but also shown to occur on local instance

@eeyrjmr
Copy link
Contributor Author

eeyrjmr commented Jan 2, 2022

Just tried it on my mobile on 4G, same thing

@wxiaoguang

This comment has been minimized.

@wxiaoguang
Copy link
Contributor

The error message is "Content cannot be empty."

The problem occurs when a user tries to submit a empty form, then backend&frontend can not handle it gracefully.

@wxiaoguang wxiaoguang changed the title Nested webUI when starting a review of a line within a PR Incorrect nested webUI when submitting an empty inline review within a PR Jan 2, 2022
@Gusted
Copy link
Contributor

Gusted commented Jan 2, 2022

The error message is "Content cannot be empty."

The problem occurs when a user tries to submit a empty form, then backend&frontend can not handle it gracefully.

Can reproduce now. Thanks @wxiaoguang 😄

@wxiaoguang

This comment has been minimized.

@wxiaoguang wxiaoguang added type/bug issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented labels Jan 2, 2022
@eeyrjmr
Copy link
Contributor Author

eeyrjmr commented Jan 2, 2022

I updated the original comment also. It's important to report/describe a bug clearly. joy
At the time I didn't know this was the cause, adding "something" doesn't cause this. Also once the "review has started" you don't get this ui option anymore only comments

@wxiaoguang
Copy link
Contributor

That's fine and already helps Gitea a lot 👍 (ps: if the screenshot could be more clear, then the problem could be more obvious at first glance 😊)

The updating of the original comment is to make new readers can know how the bug appends and hopefully the bug can be fixed soon.

@Gusted
Copy link
Contributor

Gusted commented Jan 2, 2022

I guess the simplest fix is to disable the buttons when their is no content? Because otherwise the patch will become quite lengthy in order for the JS to see redirects and then replace the whole DOM(Performance does ouch).

@wxiaoguang
Copy link
Contributor

There was a PR to make the edit area on Wiki pages can be requried. I am not sure whether it could help this problem:

If the empty content is the only reason to trigger this bug, it could be fixed by the required attribute.

Otherwise maybe we should re-design the AJAX requests.

Gusted added a commit to Gusted/gitea that referenced this issue Jan 2, 2022
- Report a validityError when the codeReview have no comment.
- Resolves go-gitea#18151
6543 pushed a commit that referenced this issue Jan 2, 2022
- Report a validityError when the codeReview have no comment.
- Resolves #18151
- Refactor
Chianina pushed a commit to Chianina/gitea that referenced this issue Mar 28, 2022
- Report a validityError when the codeReview have no comment.
- Resolves go-gitea#18151
- Refactor
@go-gitea go-gitea locked and limited conversation to collaborators Apr 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented type/bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants