Skip to content

Notification absolute URL error logs #270

@kyteinsky

Description

@kyteinsky

Which version of integration_openai are you using?

3.8.0

Which version of Nextcloud are you using?

v32.0.0

Which browser are you using? In case you are using the phone App, specify the Android or iOS version and device please.

No response

Describe the Bug

Server error logs are recorded due to notification's URL not being absolute.
Discovered from a quota exceeded exception testing #257

{"reqId":"Y2zhbOa7F3vcwlmwhDzs","level":2,"time":"z","remoteAddr":"192.168.21.2","user":"y","app":"no app in context","method":"GET","url":"/ocs/v2.php/apps/notifications/api/v2/notifications","message":"Link of notification is not an absolute URL and does not work in mobile and desktop clients [app: integration_openai, subject: quota_exceeded]","userAgent":"x","version":"32.0.0.2","data":[]}

ref:

$link = $this->url->getWebroot() . '/settings/user/ai';
$iconUrl = $this->url->getAbsoluteURL($this->url->imagePath(Application::APP_ID, 'app-dark.svg'));
$notification
->setParsedSubject($subject)
->setParsedMessage($content)
->setLink($link)

Expected Behavior

.

To Reproduce

  1. Get any notification to fire
  2. See the error log in nextcloud.log

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions