Skip to content

fix: throw UnknownActivityException in activity provider - #436

Open
bakiburakogun wants to merge 1 commit into
littleredbutton:masterfrom
bakiburakogun:fix/activity-unknown-activity-exception
Open

fix: throw UnknownActivityException in activity provider#436
bakiburakogun wants to merge 1 commit into
littleredbutton:masterfrom
bakiburakogun:fix/activity-unknown-activity-exception

Conversation

@bakiburakogun

Copy link
Copy Markdown

Summary

On Nextcloud 30+ the activity framework logs a deprecation warning every time a notification/activity fetch touches a BBB event:

OCA\BigBlueButton\Activity\Provider::parse() threw \InvalidArgumentException which is deprecated.
Throw \OCP\Activity\Exceptions\UnknownActivityException when the event is not known to your provider
and otherwise handle all \InvalidArgumentException yourself.

On a busy instance this shows up in the log for practically every user with BBB activities, drowning out real problems.

This PR switches the "not my app" guard in Provider::parse() to the dedicated UnknownActivityException, as requested by the deprecation message.

Compatibility

OCP\Activity\Exceptions\UnknownActivityException exists since Nextcloud 30 (@since 30.0.0), well below the app's current min-version="33" — no conditional handling needed.

Test

Running with this change on Nextcloud 34.0.3: activities render as before and the deprecation warning is gone from the log.

Nextcloud 30+ logs a deprecation warning on every notification fetch
that touches a BBB activity:

  OCA\BigBlueButton\Activity\Provider::parse() threw \InvalidArgumentException
  which is deprecated. Throw \OCP\Activity\Exceptions\UnknownActivityException
  when the event is not known to your provider ...

Use the dedicated exception instead. It exists since Nextcloud 30, well
below the app's current minimum (33).

Signed-off-by: Baki Burak Öğün <burak@burakogun.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant