marius-wieschollek / passwords

A simple, yet feature rich password manager for Nextcloud
GNU Affero General Public License v3.0
215 stars 46 forks source link

[BUG]: Using where() on non-empty WHERE part in lib/Db/SessionMapper.php #607

Closed come-nc closed 1 year ago

come-nc commented 1 year ago

⚠️ This issue respects the following points: ⚠️

Server Information

Unknown

Client Information

Browser and Version: Client OS and Version:

Bug description

I stumbled on this issue in logs, and it seems to still be present in master, since https://git.mdns.eu/nextcloud/passwords/-/blob/master/src/lib/Db/SessionMapper.php?ref_type=heads#L29 overrides what’s in https://git.mdns.eu/nextcloud/passwords/-/blob/master/src/lib/Db/AbstractMapper.php?ref_type=heads#L248

Not sure if this leads to a problematic behavior.

Steps to reproduce

-

Expected behavior

-

Nextcloud Logs

{
  "reqId": "***",
  "level": 2,
  "time": "***",
  "remoteAddr": "",
  "user": "--",
  "app": "no app in context",
  "method": "",
  "url": "--",
  "message": "Using where() on non-empty WHERE part, please verify it is intentional to not call whereAnd() or whereOr() instead. Otherwise consider creating a new query builder object or call resetQueryPart('where') first.",
  "userAgent": "--",
  "version": "27.0.2.2",
  "exception": {
    "Exception": "Doctrine\\DBAL\\Query\\QueryException",
    "Message": "Using where() on non-empty WHERE part, please verify it is intentional to not call whereAnd() or whereOr() instead. Otherwise consider creating a new query builder object or call resetQueryPart('where') first.",
    "Code": 0,
    "Trace": [
      {
        "file": "***/nextcloud/apps/passwords/lib/Db/SessionMapper.php",
        "line": 29,
        "function": "where",
        "class": "OC\\DB\\QueryBuilder\\QueryBuilder",
        "type": "->"
      },
      {
        "file": "***/nextcloud/apps/passwords/lib/Helper/CleanUp/CleanSessionsHelper.php",
        "line": 45,
        "function": "findAllOlderThan",
        "class": "OCA\\Passwords\\Db\\SessionMapper",
        "type": "->"
      },
      {
        "file": "***/nextcloud/apps/passwords/lib/Cron/CleanUpEntities.php",
        "line": 59,
        "function": "run",
        "class": "OCA\\Passwords\\Helper\\CleanUp\\CleanSessionsHelper",
        "type": "->"
      },
      {
        "file": "***/nextcloud/apps/passwords/lib/Cron/AbstractTimedJob.php",
        "line": 59,
        "function": "runJob",
        "class": "OCA\\Passwords\\Cron\\CleanUpEntities",
        "type": "->"
      },
      {
        "file": "***/nextcloud/lib/public/BackgroundJob/Job.php",
        "line": 81,
        "function": "run",
        "class": "OCA\\Passwords\\Cron\\AbstractTimedJob",
        "type": "->"
      },
      {
        "file": "***/nextcloud/lib/public/BackgroundJob/TimedJob.php",
        "line": 103,
        "function": "start",
        "class": "OCP\\BackgroundJob\\Job",
        "type": "->"
      },
      {
        "file": "***/nextcloud/lib/public/BackgroundJob/TimedJob.php",
        "line": 93,
        "function": "start",
        "class": "OCP\\BackgroundJob\\TimedJob",
        "type": "->"
      },
      {
        "file": "***/nextcloud/cron.php",
        "line": 152,
        "function": "execute",
        "class": "OCP\\BackgroundJob\\TimedJob",
        "type": "->"
      }
    ],
    "File": "***/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php",
    "Line": 869,
    "message": "Using where() on non-empty WHERE part, please verify it is intentional to not call whereAnd() or whereOr() instead. Otherwise consider creating a new query builder object or call resetQueryPart('where') first.",
    "exception": {},
    "CustomMessage": "Using where() on non-empty WHERE part, please verify it is intentional to not call whereAnd() or whereOr() instead. Otherwise consider creating a new query builder object or call resetQueryPart('where') first."
  }
}

Browser Logs

No response

marius-wieschollek commented 1 year ago

This should be fixed with 2023.10.0