Skip to content

Web extension: all API calls return 404 (double slash in URL join), note creation fails silently #2

Closed

Description

@gnacho

Problem

The web extension API client defines its base path with a trailing slash and concatenates request paths that start with /:

const BASE = '/index.php/apps/notes/api/v1/'   // trailing slash
get('/notes', ...)  ->  '/index.php/apps/notes/api/v1//notes'

The backend router does not collapse double slashes, so every request from the web UI returns 404. The note list area shows Request failed with status code 404 and no action works.

Additionally, the "New note" buttons call createNote() without any error handling: when the request fails the promise rejects silently (unhandled rejection), with no feedback in the UI.

Fix

  • Drop the trailing slash from BASE and keep leading slashes on paths (same join pattern as the news extension client, verified in production).
  • Wrap the create-note calls in try/catch and surface the error message in the UI.

Reproduce

  1. Open the notes app in the web UI.
  2. The list area shows an axios 404 error instead of the notes.
  3. Click "New note": nothing happens (silent failure).

Activity

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

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions