Skip to content

Failure to link an identity to an already existing account #6573

@Pablo-Ramirez-Oria-Educa360

Description

Description
When creating an Identity for an existing user from the Accounts tab, the UI shows a success toast (“Element created”), followed shortly by an error toast (“Element does not exist”).
Despite the error, the Identity record is actually created and appears in the Identities tab, but it is not linked to the selected user.

Network inspection and backend logs indicate that, after creation, the UI attempts to query the accounts endpoint with a null account ID, resulting in a 400 error from PostgREST and preventing the identity from being properly associated.

To Reproduce
Steps to reproduce the behavior:

  1. Go to the Accounts tab in the admin UI.
  2. Click Create Identity inside one of the rows of the Accounts table
  3. Observe a toast saying “Element created”.
  4. After a few seconds, observe a second toast saying “Element does not exist”.
  5. Navigate to the Identities tab and see that the identity exists but is not linked to the user.

Expected behavior
The identity should be created and correctly linked to the selected user, with only a single success notification and no error toast.

Screenshots
N/A

Hardware

  • Device: Desktop
  • OS: Windows 11
  • Browser: Firefox

Additional context
The failing request is:

GET /api/postgrest/accounts?id=eq.null

which returns 400 Bad Request.

Backend logs show successful identity queries but failed account lookups due to a null account ID:

invalid input syntax for type bigint: "null"

The identity record is successfully created in the database, but the post-creation linking step fails.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugneeds triageFor bugs that have not yet been assigned a fix priority

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions