-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Browsers without SubmitEvent.submitter support don't work with form-fetch-action mechanism well #28319
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
Comments
What do you mean by |
Sorry if I wasn't clear. I can click on it, the page refreshes, but nothing changes in the status of the pull request. |
I'm having the same/similar issue. It's a Draft PR with one dependency.
Tried closing via the PR listing, but then it says
This seems backwards, a dependency should not prevent me from closing the PR. |
I don't think that's related. This issue occurs for me regardless of dependencies and does not throw any errors. It just reloads the page (as if the command would be processed) but the status of the PR does not change, no error given. |
Quote your issue:
How to? |
|
On try.gitea.io https://try.gitea.io/wxiaoguang/test/pulls/35 1 & 2: edit a file in a repo on a separate branch, create a PR from the branch comparison
Everything seems fine. |
I'm actually seeing the same simply with an open issue. can't close it with the button. I'll see if I can get a log. |
Double confirm: are you sure you can reproduce it on try.gitea.io? If yes, is it browser related? If no, is it custom-template related? |
I can't see anything in our gitea log. Nothing in the browser console either. no errors on the page. The behavior when checking the network request seems to be the following:
has anything in that respect changed since 1.19? |
Yes absolutely. i just tested and verified. created a new issue, tried to close it. nada. |
OK, seems Blink-based browsers have no problem (tested with edge and it works), so there may be something specific interop-wise with Pale Moon as a browser. EDIT: verified it's not a regression in Pale Moon as an older installation displays the exact same behaviour on the test instance. |
I think it's related to this one: #25258 |
Looks like that might be the problem yes. Clearly there are some issues depending on browser implementations in use as the fetch spec is pretty ambiguous when it comes to CORS, preflight and redirects and it's not guaranteed to work. You may want to revert that. |
Sorry I didn't see it ever used any CORS/pre-flight/fetch-redirects (the See the requests from Firefox: Everything there is using standard browser implementations. I don't see anything tricky. Any modern browser should work well with it.
That change benefits a lot and is the future. I do not see any reason to revert. |
I was assuming it was a fetch-redirect based on the response names. Please let me know exactly what requests you're making if you're convinced this is a web client issue. note that "standard browser implementations" in general means "Blink" but not everyone is using Blink.
Well as far as I know Goanna/UXP/Pale Moon is following the Fetch spec correctly! This is a problem as we do use gitea for our code development. If there is an issue with the implementation of Fetch in Pale Moon then please tell me what is wrong with it, as Gitea is literally the only WebUI where this problem seems to occur. Fetch is used everywhere and there have not been any reports otherwise. What exactly are the fetch API calls used here? |
About
About: note that "standard browser implementations" in general means "Blink" but not everyone is using Blink.
I think the Gitea code is also using Fetch spec correctly, and Gitea also has been using So, maybe the problem is not directly related to |
Pale Moon does NOT use Gecko. It is forked from Gecko and has been independently developed for the last decade. I looked at your quoted code, and noticed the lines you pointed out do not include the "status" attribute for the form submitted. I don't see how that is being transferred to Gitea: // doRedirect does real redirection to bypass the browser's limitations of "location"
// more details are in the backend's fetch-redirect handler
function doRedirect(redirect) {
const form = document.createElement('form');
const input = document.createElement('input');
form.method = 'post';
form.action = `${appSubUrl}/-/fetch-redirect`;
input.type = 'hidden';
input.name = 'redirect';
input.value = redirect;
form.append(input);
document.body.append(form);
form.submit();
} You synthesize a new form with "redirect:" and nothing else, so it would make sense that "status" isn't part of that submitted form... How are you handling the form submission code, exactly? maybe this has less to do with the fetch redirect and more to do with submission. Are you triggering it from JS and if so, how? |
They are really not related. See my comment above, the problem is PaleMoon lacks The |
Ah. that would do it, yes. We don't have the SubmitEvent interface at all, I think. EDIT: This by the way underlines the problem using ?. everywhere -- any errors get silenced. |
TBH, I don't know how to polyfill it .... how could the JS code know the real "submitter"? The low-level logic is:
|
I think it is the correct usage of |
I don't understand how that could be a valid scenario here. Your action is linked exclusively to a button, no? I've made a priority issue to get this implemented now since you say you don't know how to pass values to the form submission otherwise and don't want to use normal form submission and this is literally breaking our devops (and reverting gitea isn't really an option anymore since we've worked several weeks in 1.21 already). I hope there won't be any big hurdles porting this code :/ |
The form could also be submitted by: JS code, Enter, etc. So in many cases
Because tradition POST FORM causes too many problem (duplicate content, content lost, etc). You can take a look at these related issues/PRs.
For myself, I also agree (and am doing my best) to keep compatibility. For this case, I already checked the MDN, it shows that all recent browsers have supported such feature for long time. I couldn't figure out which feature works with PaleMoon while which don't ahead ...... |
Hey I fully understand. The problem is that many specs these days are moving targets created almost exclusively by Google who benefit greatly from an implementation-first ecosystem, and we're often explicitly not included in any spec discussions or notifications (because we apparently pissed off the wrong people by existing independently, and Mozilla apparently hates us and has tried their best to cancel us -- including defamatory statements by Mozilla employees in official Mozilla chatrooms) so we can get blindsided by the sudden use of a less well-known addition that has had almost zero documentation or implementation notes attached (like this one). We're a small team, the whole of web specs is obscenely large, and have to be reactive as a result. I absolutely understand you're doing your best as well to stay compatible as broadly as possible, and that the previous method apparently caused issues for you (although we've never seen problems with duplicate or lost content in Gitea from Pale Moon...) so we're having to find a way around it. I just recapped the situation; it wasn't a complaint so please don't see it that way. |
I've managed to find a tricky approach to polyfill. Try "Polyfill SubmitEvent for PaleMoon #28441" It's not perfect because it doesn't work well with "focus", while I guess most people used to click/touch the buttons on the UI 🤣 |
Thanks for trying to polyfill! So far Ive not had much luck porting stuff across on our end so it's probably going to be tricky because of our divergence from Gecko.
I'm sorry but I don't how I could try that. I know nothing about Go... |
You don't need to know anything about it to test it. git clone git@github.com:go-gitea/gitea.git
cd gitea
git fetch origin pull/28441/heads:28441-palemoon-submitevent
git switch 28441-palemoon-submitevent
TAGS="bindata sqlite sqlite_unlock_notify" make build |
Thanks for the pointers. |
Thanks for the quick turnaround here! I'm assuming this will be uplifted to 1.21.3? what's the planned release date for that? |
You can use the nightly build. @techknowlogick Would you like to use "1.21-nightly" for the directory name? Then it doesn't need to explain again and again, and the FAQ can be removed. |
Okay got it. I wasn't aware that "1.21" was "1.21-release-nightly". I generally don't want to run nightly builds on production but this is of course an exception. I'll update to 1.21.3 when it's out in due course. |
Good news. That'll be soon. |
I just don't want to repeat that "1.21 is 1.21-nightly" again and again, it confuses many users.
There is no difference for stability between 1.21-nighty and 1.21.3. Actually, 1.21-nightly will become 1.21.3. |
Backport go-gitea#28441 by wxiaoguang Fix go-gitea#28319 It only polyfills if there is no "SubmitEvent" class, so it has no side effect for most users. Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> (cherry picked from commit 6af698f)
Description
I recently updated to 1.21.0 and am running into an issue now that I cannot close or re-open pull requests from the discussion page buttons at the bottom (neither with or without comment). I did not have this issue on our last version (1.19.4).
I am still able to open and close pull requests from the pull request listing (checking the boxes then clicking the close button).
I have not seen any error message be thrown in the UI.
Gitea Version
1.21.0
Can you reproduce the bug on the Gitea demo site?
Yes
Log Gist
No response
Screenshots
Git Version
No response
Operating System
CentOS 7
How are you running Gitea?
Binary download from gitea distr. natively installed (command-line/service)
Database
MySQL/MariaDB
The text was updated successfully, but these errors were encountered: