Monday, September 25, 2017

Django messages are not shown if chrome data saver is enabled.

Intro: Google data saver is a chrome plugin that compresses data toreduce traffic usage. It is enabled by default in mobile (android) chrome and might be used in desktop chrome also.

Environment: Python 3.5, Django 1.10.8/1.11.5 (reproducible on both), uwsgi+nginx. 

Application: simple app with one "submit" button on main page that triggers the view method:

def welcome_view(request):
    if request.method == 'POST':
        messages.add_message(request, messages.INFO, "succeed")
        return HttpResponseRedirect('/')
    else:
        return render(request, 'index.html')

Full app attached in zip file (12 KB).

Deployed application available at fqtest.ru

Steps to reproduce:
1. Deploy to some server (or use mine fqtest.ru). Don't forget to specify allowed hosts in settigs.py. 
2. Turn off chrome data saver plugin if you have it or use launch ingognito mode.
3. Open main page and click Go bitton. Result: message shown as expected
4. Turn on data saver plugin or install it
5. Open main page and click Go bitton. Result: message NOT shown while it should be.

Severity: high. Anyone who uses app from android phone will see no messages at all.

Questions:
  • What are reasons of this behavior?
  • How can it be fixed/worked around?
Hope for help. Thanks!

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/e00fb9e5-a3ee-40e3-b2bb-fae37c0d8b13%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment