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

pressing vote multiple times when activating notifications breaks the current poll #371

Closed
SimJoSt opened this issue Aug 30, 2018 · 1 comment
Milestone

Comments

@SimJoSt
Copy link
Contributor

SimJoSt commented Aug 30, 2018

Steps to reproduce

  1. Create poll
  2. Check the notification box
  3. Press vote multiple times before the page reloads

(I couldn't reproduce it every time; press vote a lot)

Expected behaviour

The vote should go through and the notifications should be enabled and no errors should be shown after the page finished reloading.

Actual behaviour

After the refresh, an error is shown.
The Nextcloud logs show, that the query to get the notification values returned multiple entries for the current user.
It's possible to fix the error by deleting the duplicate entries by hand.

Server configuration detail

Operating system: Linux 4.9.0-6-amd64 #1 SMP Debian 4.9.82-1+deb9u3 (2018-03-02) x86_64

Webserver: Apache/2.4.25 (Debian) (apache2handler)

Database: mysql 8.0.11

PHP version:

7.1.20
Modules loaded: Core, date, libxml, openssl, pcre, sqlite3, zlib, ctype, curl, dom, fileinfo, filter, ftp, hash, iconv, json, mbstring, SPL, PDO, session, posix, Reflection, standard, SimpleXML, pdo_sqlite, Phar, tokenizer, xml, xmlreader, xmlwriter, mysqlnd, apache2handler, apcu, exif, gd, intl, ldap, mcrypt, memcached, pcntl, pdo_mysql, pdo_pgsql, redis, zip, Zend OPcache

Nextcloud version: 13.0.5 - 13.0.5.2

Updated from an older Nextcloud/ownCloud or fresh install:

Where did you install Nextcloud from: official Docker image

Signing status

Array
(
)

List of activated apps
Enabled:
 - activity: 2.6.1
 - admin_audit: 1.3.0
 - announcementcenter: 3.2.1
 - apporder: 0.5.0
 - bruteforcesettings: 1.1.0
 - calendar: 1.6.1
 - camerarawpreviews: 0.5.6
 - checksum: 0.4.0
 - circles: 0.14.1
 - comments: 1.3.0
 - contacts: 2.1.5
 - dav: 1.4.7
 - deck: 0.4.1
 - drawio: 0.9.0
 - dropit: 0.1.1
 - federatedfilesharing: 1.3.1
 - federation: 1.3.0
 - files: 1.8.0
 - files_downloadactivity: 1.2.0
 - files_external: 1.4.1
 - files_linkeditor: 1.0.7
 - files_markdown: 2.0.4
 - files_pdfviewer: 1.2.1
 - files_reader: 1.2.3
 - files_rightclick: 0.8.4
 - files_sharing: 1.5.0
 - files_texteditor: 2.5.1
 - files_trashbin: 1.3.0
 - files_versions: 1.6.0
 - files_videoplayer: 1.2.0
 - firstrunwizard: 2.2.1
 - flowupload: 0.0.7
 - gallery: 18.0.0
 - groupfolders: 1.3.3
 - impersonate: 1.0.4
 - issuetemplate: 0.4.0
 - logreader: 2.0.0
 - lookup_server_connector: 1.1.0
 - mail: 0.8.3
 - metadata: 0.7.0
 - mindmaps: 0.1.0
 - music: 0.9.0
 - nextcloud_announcements: 1.2.0
 - notes: 2.4.0
 - notifications: 2.1.2
 - oauth2: 1.1.1
 - onlyoffice: 2.0.2
 - ownpad: 0.6.8
 - password_policy: 1.3.0
 - polls: 0.8.1
 - previewgenerator: 1.1.0
 - provisioning_api: 1.3.0
 - quota_warning: 1.2.0
 - ransomware_protection: 1.1.1
 - richdocuments: 2.0.11
 - serverinfo: 1.3.0
 - sharebymail: 1.3.0
 - socialsharing_email: 1.0.3
 - spreed: 3.2.5
 - systemtags: 1.3.0
 - tasks: 0.9.6
 - theming: 1.4.5
 - twofactor_backupcodes: 1.2.3
 - twofactor_totp: 1.4.1
 - twofactor_u2f: 1.5.5
 - twofactor_yubikey: 0.3.0
 - updatenotification: 1.3.0
 - user_external: 0.4
 - workflowengine: 1.3.0
Disabled:
 - audioplayer
 - encryption
 - external
 - files_accesscontrol
 - files_automatedtagging
 - files_retention
 - keeweb
 - survey_client
 - user_ldap

Configuration (config/config.php)
{
    "instanceid": "***REMOVED SENSITIVE VALUE***",
    "passwordsalt": "***REMOVED SENSITIVE VALUE***",
    "secret": "***REMOVED SENSITIVE VALUE***",
    "trusted_domains": [
        "***REMOVED SENSITIVE VALUE***",
        "***REMOVED SENSITIVE VALUE***",
    ],
    "datadirectory": "***REMOVED SENSITIVE VALUE***",
    "dbtype": "mysql",
    "version": "13.0.5.2",
    "dbname": "***REMOVED SENSITIVE VALUE***",
    "dbhost": "***REMOVED SENSITIVE VALUE***",
    "dbuser": "***REMOVED SENSITIVE VALUE***",
    "dbpassword": "***REMOVED SENSITIVE VALUE***",
    "installed": true,
    "forcessl": true,
    "logtimezone": "Europe\/Berlin",
    "log_rotate_size": 104857600,
    "mail_from_address": "***REMOVED SENSITIVE VALUE***",
    "mail_domain": "***REMOVED SENSITIVE VALUE***",
    "mail_smtpauth": true,
    "mail_smtpauthtype": "LOGIN",
    "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
    "mail_smtpmode": "smtp",
    "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
    "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
    "mail_smtpport": "465",
    "mail_smtpsecure": "ssl",
    "htaccess.RewriteBase": "\/",
    "overwrite.cli.url": "***REMOVED SENSITIVE VALUE***",
    "skeletondirectory": "",
    "auth.bruteforce.protection.enabled": true,
    "check_for_working_webdav": true,
    "maintenance": false,
    "loglevel": 0,
    "memcache.local": "\\OC\\Memcache\\APCu",
    "apps_paths": [
        {
            "path": "\/var\/www\/html\/apps",
            "url": "\/apps",
            "writable": false
        },
        {
            "path": "\/var\/www\/html\/custom_apps",
            "url": "\/custom_apps",
            "writable": true
        }
    ],
    "memcache.locking": "\\OC\\Memcache\\Redis",
    "redis": {
        "host": "***REMOVED SENSITIVE VALUE***",
        "port": 6379
    }
}

Are you using external storage, if yes which one: sftp

Are you using encryption:

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

Client configuration

Browser: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36

Operating system: Debian

Logs

Nextcloud log

{"reqId":"z3hyOr6vyTNNVmyptYrU","level":3,"time":"2018-08-30T12:23:55+02:00","remoteAddr":"REMOVED SENSITIVE VALUE","user":"REMOVED SENSITIVE VALUE","app":"index","method":"GET","url":"/apps/polls/poll/REMOVED SENSITIVE VALUE","message":"Exception: {"Exception":"OCP\\AppFramework\\Db\\MultipleObjectsReturnedException","Message":"Did not expect more than one result when executing: query \"SELECT * FROM PREFIXpolls_notif WHERE poll_id = ? AND user_id = ?\"; parameters Array\n(\n [0] => 18\n [1] => REMOVED SENSITIVE VALUE\n)\n; limit \"\"; offset \"\"","Code":0,"Trace":"#0 \/var\/www\/html\/lib\/public\/AppFramework\/Db\/Mapper.php(359): OCP\\AppFramework\\Db\\Mapper->findOneQuery('SELECT * FROM *...', Array, NULL, NULL)\n#1 \/var\/www\/html\/custom_apps\/polls\/lib\/Db\/NotificationMapper.php(89): OCP\\AppFramework\\Db\\Mapper->findEntity('SELECT * FROM *...', Array)\n#2 \/var\/www\/html\/custom_apps\/polls\/lib\/Controller\/PageController.php(238): OCA\\Polls\\Db\\NotificationMapper->findByUserAndPoll(18, 'REMOVED SENSITIVE VALUE')\n#3 [internal function]: OCA\\Polls\\Controller\\PageController->gotoPoll('REMOVED SENSITIVE VALUE...')\n#4 \/var\/www\/html\/lib\/private\/AppFramework\/Http\/Dispatcher.php(161): call_user_func_array(Array, Array)\n#5 \/var\/www\/html\/lib\/private\/AppFramework\/Http\/Dispatcher.php(91): OC\\AppFramework\\Http\\Dispatcher->executeController(Object(OCA\\Polls\\Controller\\PageController), 'gotoPoll')\n#6 \/var\/www\/html\/lib\/private\/AppFramework\/App.php(115): OC\\AppFramework\\Http\\Dispatcher->dispatch(Object(OCA\\Polls\\Controller\\PageController), 'gotoPoll')\n#7 \/var\/www\/html\/lib\/private\/AppFramework\/Routing\/RouteActionHandler.php(47): OC\\AppFramework\\App::main('PageController', 'gotoPoll', Object(OC\\AppFramework\\DependencyInjection\\DIContainer), Array)\n#8 [internal function]: OC\\AppFramework\\Routing\\RouteActionHandler->__invoke(Array)\n#9 \/var\/www\/html\/lib\/private\/Route\/Router.php(297): call_user_func(Object(OC\\AppFramework\\Routing\\RouteActionHandler), Array)\n#10 \/var\/www\/html\/lib\/base.php(999): OC\\Route\\Router->match('\/apps\/polls\/pol...')\n#11 \/var\/www\/html\/index.php(42): OC::handleRequest()\n#12 {main}","File":"\/var\/www\/html\/lib\/public\/AppFramework\/Db\/Mapper.php","Line":284}","userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36","version":"13.0.5.2"}

@dartcafe dartcafe added this to the 0.8.4 milestone Aug 31, 2018
@dartcafe
Copy link
Collaborator

Added disabling vote button after click.

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