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

fix(activity): Fix permission checks when rendering activities in bac… #5533

Merged

Conversation

nickvergessen
Copy link
Member

…kground jobs

  • Resolves:
{
  "reqId": "AwQLI2pqTBuljW0TBR8z",
  "level": 3,
  "time": "2024-01-29T08:01:05+00:00",
  "remoteAddr": "",
  "user": "--",
  "app": "core",
  "method": "",
  "url": "--",
  "message": "Error while running background job (class: OCA\\Activity\\BackgroundJob\\EmailNotification, arguments: )",
  "userAgent": "--",
  "version": "28.0.2.3",
  "exception": {
    "Exception": "TypeError",
    "Message": "OC\\Group\\Manager::getUserIdGroupIds(): Argument #1 ($uid) must be of type string, null given, called in …/lib/private/Group/Manager.php on line 374",
    "Code": 0,
    "Trace": [
      {
        "file": "…/lib/private/Group/Manager.php",
        "line": 374,
        "function": "getUserIdGroupIds",
        "class": "OC\\Group\\Manager",
        "type": "->",
        "args": [
          null
        ]
      },
      {
        "file": "…/apps/deck/lib/Service/PermissionService.php",
        "line": 234,
        "function": "isInGroup",
        "class": "OC\\Group\\Manager",
        "type": "->",
        "args": [
          null,
          "M…g"
        ]
      },
      {
        "file": "…/apps/deck/lib/Service/PermissionService.php",
        "line": 115,
        "function": "userCan",
        "class": "OCA\\Deck\\Service\\PermissionService",
        "type": "->",
        "args": [
          [
            [
              "OCA\\Deck\\Db\\Acl",
              51
            ],
            [
              "OCA\\Deck\\Db\\Acl",
              54
            ],
            [
              "OCA\\Deck\\Db\\Acl",
              55
            ],
            [
              "OCA\\Deck\\Db\\Acl",
              93
            ],
            [
              "OCA\\Deck\\Db\\Acl",
              290
            ]
          ],
          0,
          null
        ]
      },
      {
        "file": "…/apps/deck/lib/Service/PermissionService.php",
        "line": 160,
        "function": "getPermissions",
        "class": "OCA\\Deck\\Service\\PermissionService",
        "type": "->",
        "args": [
          250,
          null
        ]
      },
      {
        "file": "…/apps/deck/lib/Activity/ActivityManager.php",
        "line": 571,
        "function": "checkPermission",
        "class": "OCA\\Deck\\Service\\PermissionService",
        "type": "->",
        "args": [
          [
            "OCA\\Deck\\Db\\CardMapper"
          ],
          7871,
          0
        ]
      },
      {
        "file": "…/apps/deck/lib/Activity/DeckProvider.php",
        "line": 131,
        "function": "canSeeCardActivity",
        "class": "OCA\\Deck\\Activity\\ActivityManager",
        "type": "->",
        "args": [
          7871
        ]
      },
      {
        "file": "…/apps/activity/lib/MailQueueHandler.php",
        "line": 436,
        "function": "parse",
        "class": "OCA\\Deck\\Activity\\DeckProvider",
        "type": "->",
        "args": [
          "en",
          [
            "OC\\Activity\\Event"
          ]
        ]
      },
      {
        "file": "…/apps/activity/lib/MailQueueHandler.php",
        "line": 333,
        "function": "parseEvent",
        "class": "OCA\\Activity\\MailQueueHandler",
        "type": "->",
        "args": [
          "en",
          [
            "OC\\Activity\\Event"
          ]
        ]
      },
      {
        "file": "…/apps/activity/lib/MailQueueHandler.php",
        "line": 130,
        "function": "sendEmailToUser",
        "class": "OCA\\Activity\\MailQueueHandler",
        "type": "->",
        "args": [
          "m…a",
          "m…m",
          "en",
          "Europe/Tirane",
          1706515264
        ]
      },
      {
        "file": "…/apps/activity/lib/BackgroundJob/EmailNotification.php",
        "line": 60,
        "function": "sendEmails",
        "class": "OCA\\Activity\\MailQueueHandler",
        "type": "->",
        "args": [
          500,
          1706515264
        ]
      },
      {
        "file": "…/lib/private/BackgroundJob/Job.php",
        "line": 54,
        "function": "run",
        "class": "OCA\\Activity\\BackgroundJob\\EmailNotification",
        "type": "->",
        "args": [
          null
        ]
      },
      {
        "file": "…/lib/private/BackgroundJob/TimedJob.php",
        "line": 60,
        "function": "execute",
        "class": "OC\\BackgroundJob\\Job",
        "type": "->",
        "args": [
          [
            "OC\\BackgroundJob\\JobList"
          ],
          [
            "OC\\Log"
          ]
        ]
      },
      {
        "file": "…/cron.php",
        "line": 152,
        "function": "execute",
        "class": "OC\\BackgroundJob\\TimedJob",
        "type": "->",
        "args": [
          [
            "OC\\BackgroundJob\\JobList"
          ],
          [
            "OC\\Log"
          ]
        ]
      }
    ],
    "File": "…/lib/private/Group/Manager.php",
    "Line": 391,
    "message": "Error while running background job (class: OCA\\Activity\\BackgroundJob\\EmailNotification, arguments: )",
    "CustomMessage": "Error while running background job (class: OCA\\Activity\\BackgroundJob\\EmailNotification, arguments: )"
  }
}

Summary

TODO

  • ...

Checklist

  • Code is properly formatted
  • Sign-off message is added to all commits
  • Tests (unit, integration, api and/or acceptance) are included
  • Documentation (manuals or wiki) has been updated or is not required

@juliusknorr juliusknorr merged commit 74cf8d8 into main Feb 2, 2024
32 checks passed
@delete-merged-branch delete-merged-branch bot deleted the bugfix/noid/fix-permission-check-in-background-job branch February 2, 2024 12:55
@juliusknorr
Copy link
Member

/backport to stable28

@juliusknorr
Copy link
Member

/backport to stable27

@juliusknorr
Copy link
Member

/backport to stable26

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants