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

Refactor how we submit a bug #2288

Closed
miketaylr opened this issue Mar 22, 2018 · 6 comments
Closed

Refactor how we submit a bug #2288

miketaylr opened this issue Mar 22, 2018 · 6 comments

Comments

@miketaylr
Copy link
Member

See #2276 (comment) and related discussion.

Basically, if/when an image is sent to upload.py and returns a 415, the bug report form should do something intelligent. At the very least, remove the problematic image and inform the user we don't like it.

@miketaylr
Copy link
Member Author

(this is a post refactor issue)

@Regaddi
Copy link
Member

Regaddi commented Apr 17, 2018

Is this still an "issue"?

image

@miketaylr
Copy link
Member Author

Is this still an "issue"?

I think so. I was just realizing the way we handle form submit is kinda... wonky.

Right now on submit we call maybeUploadImage, and rely on the success handler to submit the actual form. Obviously if we don't end up in success, that won't happen.

So probably maybeUploadImage needs to give control back to the onFormSubmit handler (which isn't on master right now, but comes from #2415) and decide what to do: either submit the form, or go into an error condition.

@miketaylr
Copy link
Member Author

go into an error condition.

#2276 (comment) is one idea to explore.

@miketaylr miketaylr added this to the April / May / June 2018 milestone Apr 23, 2018
@miketaylr miketaylr changed the title Gracefully handle 415 errors on the client side Refactor how we submit a bug Apr 23, 2018
@miketaylr
Copy link
Member Author

Changing the title, but we should be sure it also covers error conditions.

@miketaylr miketaylr self-assigned this Apr 23, 2018
@miketaylr
Copy link
Member Author

Would be nice to use Promises... or at least jQuery.Deferred. I wonder how painful an upgrade from jQ 1.11.X to 3.X would be (I'm pretty sure we don't try to support IE8 anyways)...

miketaylr added a commit that referenced this issue Apr 24, 2018
miketaylr added a commit that referenced this issue Apr 24, 2018
miketaylr added a commit that referenced this issue Apr 24, 2018
miketaylr added a commit that referenced this issue Apr 26, 2018
And organize some local variables as props on BugForm.
miketaylr added a commit that referenced this issue Apr 26, 2018
Now we use jQuery Deferreds (Promises/A+ compatible) to handle
success and error conditions. If an image passes validation on the server,
the issue will be sumitted. If there's a problem, it won't be submitted
and the user will have to upload a new image and try again.
miketaylr added a commit that referenced this issue Apr 26, 2018
miketaylr added a commit that referenced this issue Apr 30, 2018
miketaylr added a commit that referenced this issue Apr 30, 2018
miketaylr added a commit that referenced this issue Apr 30, 2018
miketaylr added a commit that referenced this issue Apr 30, 2018
(and do some selenium hax for firefox so it works)
miketaylr added a commit that referenced this issue Apr 30, 2018
miketaylr added a commit that referenced this issue Apr 30, 2018
miketaylr added a commit that referenced this issue Apr 30, 2018
miketaylr added a commit that referenced this issue Apr 30, 2018
miketaylr added a commit that referenced this issue Apr 30, 2018
(and do some selenium hax for firefox so it works)
miketaylr added a commit that referenced this issue Apr 30, 2018
miketaylr added a commit that referenced this issue Apr 30, 2018
miketaylr added a commit that referenced this issue Apr 30, 2018
(and do some selenium hax for firefox so it works)
miketaylr added a commit that referenced this issue Apr 30, 2018
miketaylr added a commit that referenced this issue Apr 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants