Skip to content

External notification links are incorrectly prefixed with the frontend base URL #12844

Closed

Description

@Leopoldius

Please verify that this bug has NOT been raised before.

  • I checked and didn't find a similar issue

Describe the bug*

External links provided by notifications are incorrectly prefixed with the InvenTree frontend base URL.

This was observed with the built-in update_available notification after the fixes from #12399 / #12424 and #12706 / #12744.

The backend correctly stores and serializes the GitHub release URL:

{
  "target": {
    "model_type": "pluginconfig",
    "model_id": 10,
    "link": "https://github.com/inventree/InvenTree/releases/tag/1.5.4"
  }
}

However, NotificationDrawer currently constructs the anchor as:

<Anchor
  href={link ? `/${getBaseUrl()}${link}` : '#'}

With the default frontend base URL web, the valid external URL:

https://github.com/inventree/InvenTree/releases/tag/1.5.4

becomes:

/webhttps://github.com/inventree/InvenTree/releases/tag/1.5.4

and is resolved by the browser as:

https://parts.embedded.homes/webhttps://github.com/inventree/InvenTree/releases/tag/1.5.4

I verified this on the official inventree/inventree:1.5.4 Docker image.

The database contains the correct NotificationMessage.link, and NotificationMessageSerializer also returns the correct external URL. The corruption therefore occurs in the frontend when the notification anchor href is constructed.

The attached screenshot shows the malformed URL in the browser status bar when hovering over the Update Available notification.

The same href={link ? /${getBaseUrl()}${link} : '#'} code is currently also present in master.

Demo site

I also checked the InvenTree demo site. However, the demo instance is currently up to date and does not have an update_available notification, so I could not reproduce this exact notification path there.

Image

Steps to Reproduce

  1. Run InvenTree with a notification containing an absolute external URL.
  2. For example, use the built-in update_available notification generated when a newer InvenTree release is available.
  3. Open the Notifications drawer.
  4. Hover over the Update Available notification.
  5. Observe the URL shown by the browser.
  6. Click the notification.
  7. The browser navigates to a malformed URL on the current InvenTree host instead of the external URL.

Example:

Notification link:
https://github.com/inventree/InvenTree/releases/tag/1.5.4

Generated href:
/webhttps://github.com/inventree/InvenTree/releases/tag/1.5.4

Browser destination:
https://parts.embedded.homes/webhttps://github.com/inventree/InvenTree/releases/tag/1.5.4

Expected behaviour

Explicit external notification URLs should be used unchanged.

For example:

https://github.com/inventree/InvenTree/releases/tag/1.5.4

should navigate directly to that URL.

Internal notification URLs should still receive the frontend base URL when required, while URLs which already contain the base URL should not be prefixed again.

Expected handling:

https://example.com/path    -> https://example.com/path
/settings/admin/            -> /web/settings/admin/
/web/settings/admin/        -> /web/settings/admin/

Deployment Method

Docker

Version Information

InvenTree-Version: 1.5.4
Django Version: 5.2.16
Commit Hash: d2db7b1
Commit Date: 2026-09-09
Commit Branch: None
Database: django.db.backends.postgresql
Debug-Mode: False
Deployed using Docker: True
Platform: Linux-6.12.95+deb13-amd64-x86_64-with-glibc2.41
Installer: DOC
Active plugins: [{"name":"InvenTreeBarcode","slug":"inventreebarcode","version":"2.2.0"},{"name":"BOM Exporter","slug":"bom-exporter","version":"1.1.0"},{"name":"InvenTree Exporter","slug":"inventree-exporter","version":"1.0.0"},{"name":"Parameter Exporter","slug":"parameter-exporter","version":"2.0.0"},{"name":"InvenTreeEmailNotifications","slug":"inventree-email-notification","version":"1.0.0"},{"name":"InvenTreeUINotifications","slug":"inventree-ui-notification","version":"1.0.0"},{"name":"InvenTreeCurrencyExchange","slug":"inventreecurrencyexchange","version":"1.0.0"},{"name":"InvenTreeMachines","slug":"inventree-machines","version":"1.0.0"},{"name":"InvenTreeLabel","slug":"inventreelabel","version":"1.1.0"},{"name":"InvenTreeLabelMachine","slug":"inventreelabelmachine","version":"1.0.0"},{"name":"KiCadLibraryPlugin","slug":"kicad-library-plugin","version":"2.0.4"}]

Try to reproduce on the demo site

I tried to reproduce

Is the bug reproducible on the demo site?

Reproducible

Relevant log output

No server-side error is produced.

Runtime verification shows that the backend stores and serializes the correct URL:

NotificationMessage.link =
https://github.com/inventree/InvenTree/releases/tag/1.5.4

Serialized notification target link =
https://github.com/inventree/InvenTree/releases/tag/1.5.4

The malformed URL is generated only in the frontend.

I have reviewed this report for correctness and filled out all sections.

  • I have checked this report. I acknowledge that filing bugs via AI agents without review might lead to being blocked.

Activity

  1. added
    bug
    question
    triage:not-checked
    on Sep 12, 2026
  2. added theissue type on Sep 12, 2026
  3. Leopoldius commented on Sep 12, 2026

    @Leopoldius
    ContributorAuthor

    Working on PR with fix

  4. removed
    bug
    question
    triage:not-checked
    on Sep 12, 2026
  5. added this to the 1.5.5 milestone on Sep 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions