Expected:
Issue filed and redirected to the issue page, i.e. https://webcompat.com/issues/<issue-id>
Actual:
Redirect to the main page, issue gets lost
The problem seems to be that the form is not saved to session cookie, likely due to it containing too much data:
projects/webcompat.com/env/lib/python3.9/site-packages/werkzeug/sansio/response.py:235: UserWarning: The 'session' cookie is too large: the value was 6970 bytes but the header required 26 extra bytes. The final size was 6996 bytes but the limit is 4093 bytes. Browsers may silently ignore cookies larger than this.
The saving is happening here:
# Authenticated reporting
if form.get('submit_type') == 'github-auth-report':
if g.user:
...
else:
# Stash form data into session, go do GitHub auth
session['form'] = form
return redirect(url_for('login'))
And at retrieval session.get('form', None) is actually None:
# OAuth2 callback handler that GitHub requires.
# If this moves, it needs to change in GitHub settings as well
@app.route('/callback')
@github.authorized_handler
def authorized(access_token=None):
"""Set the callback route for oauth2 with GitHub."""
...
...
if session.get('form', None) is not None:
return redirect(url_for('file_issue'))
else:
return redirect(g.referer)
It only happens on some websites and I think the reason is the large amount of console logs. To fix this, we can strip the console logs from the form, since it's being saved in a separate file anyways.
STR:
Expected: Issue filed and redirected to the issue page, i.e.
https://webcompat.com/issues/<issue-id>
Actual: Redirect to the main page, issue gets lost
The problem seems to be that the form is not saved to session cookie, likely due to it containing too much data:
projects/webcompat.com/env/lib/python3.9/site-packages/werkzeug/sansio/response.py:235: UserWarning: The 'session' cookie is too large: the value was 6970 bytes but the header required 26 extra bytes. The final size was 6996 bytes but the limit is 4093 bytes. Browsers may silently ignore cookies larger than this.
The saving is happening here:
And at retrieval
session.get('form', None)
is actuallyNone
:This is a variation of https://github.com/webcompat/webcompat.com/issues/3508.
It only happens on some websites and I think the reason is the large amount of console logs. To fix this, we can strip the console logs from the form, since it's being saved in a separate file anyways.