Skip to content

Conversation

@provokateurin
Copy link
Member

@provokateurin provokateurin commented Apr 8, 2025

Fixes #51427
Fixes nextcloud/activity#1875

Summary

#47662 was a bit too hard and has caused quite a few issues because there are so many places that are wrong.
While it makes developers more aware, it also breaks a lot of users which is not good. Therefore I'm downgrading it to an error message for now, so developers hopefully still notice it.

Checklist

@provokateurin provokateurin added bug 3. to review Waiting for reviews labels Apr 8, 2025
@provokateurin provokateurin added this to the Nextcloud 32 milestone Apr 8, 2025
@provokateurin provokateurin requested a review from a team as a code owner April 8, 2025 09:42
@provokateurin provokateurin requested review from artonge, come-nc and icewind1991 and removed request for a team April 8, 2025 09:42
@provokateurin
Copy link
Member Author

/backport to stable31

…ring in validator

Signed-off-by: provokateurin <kate@provokateurin.de>
@provokateurin provokateurin force-pushed the fix/richobjectstrings/validator-string-key-value-error branch from c0f05a3 to fd156d3 Compare April 8, 2025 09:45
]);
$this->addToAssertionCount(2);

$this->expectException(InvalidObjectExeption::class);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should add the expected logger call here instead

@provokateurin provokateurin merged commit ba2b778 into master Apr 8, 2025
190 checks passed
@provokateurin provokateurin deleted the fix/richobjectstrings/validator-string-key-value-error branch April 8, 2025 11:17
@juliusknorr
Copy link
Member

juliusknorr commented Apr 9, 2025

This is causing some log spam on our instance:

image

Some rare cases happened before, but not in that amount.

Edit: Seems the new log catches more code paths where is was probably catched before

root@cloud1:~# grep "Object for placeholder" /var/www/data/nextcloud.log* | grep 2025-04-08T19 | cut -d ':' -f 2- | jq .url | sort -h | uniq -c
      2 "--"
   9077 "/ocs/v2.php/apps/notifications/api/v2/notifications"
    854 "/ocs/v2.php/apps/notifications/api/v2/notifications?format=json"
root@cloud1:~# grep "Object for placeholder" /var/www/data/nextcloud.log* | grep 2025-04-08T0 | cut -d ':' -f 2- | jq .url | sort -h | uniq -c
     39 "/ocs/v2.php/apps/dashboard/api/v2/widget-items?widgets%5B%5D=activity"

@nickvergessen
Copy link
Member

nickvergessen commented Apr 9, 2025

Yeah it was muted and caught in activity and notifications:

try {
$this->richValidator->validate($this->getRichSubject(), $this->getRichSubjectParameters());
} catch (InvalidObjectExeption $e) {
return false;
}

try {
$this->richValidator->validate($this->getRichSubject(), $this->getRichSubjectParameters());
} catch (InvalidObjectExeption $e) {
return false;
}

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

Labels

3. to review Waiting for reviews bug

Projects

None yet

7 participants