nextcloud / polls

🗳️ Polls app for Nextcloud
https://apps.nextcloud.com/apps/polls
GNU Affero General Public License v3.0
256 stars 73 forks source link

Checked boxes are unchecked again / click does not change box status #1625

Closed ttjaden closed 3 years ago

ttjaden commented 3 years ago

What is going wrong?

Describe the bug When selecting an option with firefox browser, the checked box is unchecked again a second later

To Reproduce Steps to reproduce the behavior:

  1. Create a poll with public link
  2. Click on an option with firefox browser
  3. check box is unchecked again. With chrome there is no problem.
  4. I tested 6 different laptops with chrome and firefox and beforehand deleted all browser cache etc.
  5. Firefox seems to have this issue

https://user-images.githubusercontent.com/16917049/118722243-3ad45d80-b82c-11eb-8a33-219c3312bf53.mp4

Expected behavior Option stay checked

Screenshots See above

Information about your polls installation

1.8.3

Fresh installation or update from a prior version (from which one)? Fresh installation

How did you install this version?(Appstore or describe installation) Appstore

Information about your Instance of Nextcloud

Nextcloud version: (see Nextcloud admin page) 21.0.1

List of activated apps:

enabled:
  - accessibility: 1.7.0
  - activity: 2.14.3
  - admin_audit: 1.11.0
  - apporder: 0.12.0
  - bruteforcesettings: 2.1.0
  - calendar: 2.2.1
  - cloud_federation_api: 1.4.0
  - comments: 1.11.0
  - contacts: 3.5.1
  - contactsinteraction: 1.2.0
  - dashboard: 7.1.0
  - dav: 1.17.1
  - drawio: 1.0.0
  - external: 3.8.1
  - federatedfilesharing: 1.11.0
  - federation: 1.11.0
  - files: 1.16.0
  - files_external: 1.12.0
  - files_pdfviewer: 2.1.0
  - files_rightclick: 1.0.0
  - files_sharing: 1.13.1
  - files_trashbin: 1.11.0
  - files_versions: 1.14.0
  - files_videoplayer: 1.10.0
  - forms: 2.2.4
  - groupfolders: 9.0.1
  - impersonate: 1.8.0
  - integration_github: 1.0.0
  - integration_moodle: 1.0.0
  - integration_whiteboard: 0.0.14
  - logreader: 2.6.0
  - lookup_server_connector: 1.9.0
  - mail: 1.9.5
  - nextcloud_announcements: 1.10.0
  - notifications: 2.9.0
  - notify_push: 0.1.7
  - oauth2: 1.9.0
  - onlyoffice: 7.0.2
  - password_policy: 1.11.0
  - polls: 1.8.3
  - privacy: 1.5.0
  - provisioning_api: 1.11.0
  - recommendations: 1.0.0
  - registration: 1.2.1
  - serverinfo: 1.11.0
  - settings: 1.3.0
  - sharebymail: 1.11.0
  - spreed: 11.2.1
  - support: 1.4.0
  - systemtags: 1.11.0
  - tasks: 0.13.6
  - text: 3.2.0
  - theming: 1.12.0
  - twofactor_backupcodes: 1.10.0
  - updatenotification: 1.11.0
  - user_status: 1.1.1
  - viewer: 1.5.0
  - weather_status: 1.1.0
  - workflowengine: 2.3.0
Disabled:
  - encryption
  - firstrunwizard
  - photos
  - richdocuments
  - richdocumentscode
  - survey_client
  - user_ldap

Nextcloud configuration:

{
    "system": {
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "******"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "21.0.1.1",
        "overwrite.cli.url": "*******",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "activity_expire_days": 14,
        "auth.bruteforce.protection.enabled": true,
        "blacklisted_files": [
            ".htaccess",
            "Thumbs.db",
            "thumbs.db"
        ],
        "cron_log": true,
        "default_phone_region": "DE",
        "default_language": "de",
        "default_locale": "de",
        "force_locale": "de",
        "enable_previews": true,
        "enabledPreviewProviders": [
            "OC\\Preview\\PNG",
            "OC\\Preview\\JPEG",
            "OC\\Preview\\GIF",
            "OC\\Preview\\BMP",
            "OC\\Preview\\XBitmap",
            "OC\\Preview\\Movie",
            "OC\\Preview\\PDF",
            "OC\\Preview\\MP3",
            "OC\\Preview\\TXT",
            "OC\\Preview\\MarkDown"
        ],
        "filesystem_check_changes": 1,
        "filelocking.enabled": "true",
        "htaccess.RewriteBase": "\/",
        "integrity.check.disabled": false,
        "knowledgebaseenabled": false,
        "log_rotate_size": 104857600,
        "logfile": "\/nextcloud_local\/nextcloud.log",
        "logtimezone": "Europe\/Berlin",
        "memcache.local": "\\OC\\Memcache\\APCu",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "preview_max_x": 1024,
        "preview_max_y": 768,
        "preview_max_scale_factor": 1,
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 0,
            "timeout": 0
        },
        "quota_include_external_storage": false,
        "share_folder": "\/Freigaben",
        "skeletondirectory": "",
        "trashbin_retention_obligation": "auto, 7",
        "mail_smtpmode": "smtp",
        "mail_smtpsecure": "ssl",
        "mail_sendmailmode": "smtp",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpauthtype": "PLAIN",
        "mail_smtpauth": 1,
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "587",
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
        "maintenance": false
    }
}

Server configuration

Database: MariaDB 10.5

PHP version: 8.0

Are you using an external user-backend, if yes which one: no

Client configuration

Device: Desktop

Browser: Firefox

Logs

Browser log

a) The javascript console log

$ is deprecated: The global jQuery is deprecated. It will be updated to v3.x in Nextcloud 21. In later versions of Nextcloud it might be removed completely. Please ship your own. 55 globals.js:60:15
jQuery is deprecated: The global jQuery is deprecated. It will be updated to v3.x in Nextcloud 21. In later versions of Nextcloud it might be removed completely. Please ship your own. 48 globals.js:60:15
jQuery is deprecated: The global jQuery is deprecated. It will be updated to v3.x in Nextcloud 21. In later versions of Nextcloud it might be removed completely. Please ship your own. 12 globals.js:60:15
polls update detected 
Array [ {…} ]
polls.js:2:2063267
polls update detected 
Array [ {…} ]
polls.js:2:2063267
polls update detected 
Array [ {…} ]
polls.js:2:2063267
polls update detected 
Array [ {…} ]
polls.js:2:2063267
polls update detected 
Array [ {…} ]
polls.js:2:2063267
polls update detected 
Array [ {…} ]
polls.js:2:2063267
jQuery is deprecated: The global jQuery is deprecated. It will be updated to v3.x in Nextcloud 21. In later versions of Nextcloud it might be removed completely. Please ship your own. 156 globals.js:60:15

b) The network log grafik

dartcafe commented 3 years ago

Fetching from the cache is the issue here. This must be an ajax communication with the backend. I guess, with a forced reload, the votes are correct.

I have to check, how takint the values from the cache can be avoided.

ttjaden commented 3 years ago

Fetching from the cache is the issue here. This must be an ajax communication with the backend. I guess, with a forced reload, the votes are correct.

Yes, that's right

I have to check, how takint the values from the cache can be avoided.

This would be great! A few months ago, there were no problems with firefox. I also don't know, why the problem now appears (and why only in firefox)

dartcafe commented 3 years ago

I have no idea, because I dont't have this issue. I am using firefox, too. Maybe a setting or an add-on is the reason?

I think, something like a no-cache header must be sent. But I still have to investigate.

Can you provide the header parameters from the network tab?

ttjaden commented 3 years ago

In don't know if this is what you need grafik

with first row details

request header when voting grafik

answer header grafik

And as you suggested: A force reload results in a correct view

dartcafe commented 3 years ago

Excatly that. The response header sends cache-control: max-age=60 which tells the browser, to take every request from cache within the next 60 seconds. For the XHR-Request, this no good idea. I guess, this is a webserver setting.

It should be at least cache-control: no-cache. On my system it is cache-control: no-cache, no-store, must-revalidate

I have to check, if I can override this.

dartcafe commented 3 years ago

Just a note to myself:

I tried to change the response headers, but this has no effect.

The default headers are cache-control: no-cache, no-store, must-revalidate judging from OCP\AppFramework\Http\Response

Checking the response with Response::checkHeaders shows the headers, as expected

ttjaden commented 3 years ago

@dartcafe Can I support somehow witjh another test or something else?

dartcafe commented 3 years ago

You could check your nginx configuration, because, the cache-control from the app (better NC core) is defined to not cache the pages. So i guess that a server configuration overrides the header.

Nevertheless, I think about adding a random parameter to the requests, which should avoid caching the API-Calls.

ttjaden commented 3 years ago

Thanks for your efforts! If you have another 2min, could you have a look in this configuration? https://www.c-rieger.de/nextcloud-installationsanleitung/

This is the configuration i used (ngnix, php) for my nextcloud instance. You will find the "no-cache" option. Is this wrong or right?

dartcafe commented 3 years ago

I don't think so, but I am not an administrator and have limited experience in configuring a web server. If you are able to install the beta3 (will come this night) you could test the access with the changed request parmeters, which - I hope - will eliminate the caching of the API calls.

dartcafe commented 3 years ago

@ttjaden Any news? With the update to 2.0.2 the caching should be bypassed. Can you confirm?

ttjaden commented 3 years ago

@dartcafe Yes, now all is working as expected! Thanks a lot!

github-actions[bot] commented 5 months ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.