Skip to content

Document the admin client organizations.findOne breaking change in the 26.9 upgrading guide #53371

Description

@ssilvert

Description

PR #51717 changed organizations.findOne in @keycloak/keycloak-admin-client to resolve to undefined when the organization does not exist, instead of rejecting with a 404 error. Its declared return type changed from OrganizationRepresentation to OrganizationRepresentation | undefined.

This was a deliberate decision — it brings the method in line with groups.findOne, roles.findOneById, clients.findOne and the other resource lookups, which already resolve to undefined for a missing entity — but it is a breaking change for anyone building against the admin client, and it was merged without the corresponding upgrading-guide entry.

It is not theoretical: when #51717 merged main into its branch, the change broke three in-repo call sites (IdpDomainsTab.tsx, DomainsTab.tsx, IdpOrganizationsTab.tsx) that had been written against the old signature. Downstream consoles built on the published package will hit the same thing.

release/26.9.0 is the current target, and changes-26_9_0.adoc does not exist yet, so this needs the version file opened as well. Two edits:

1. Create docs/documentation/upgrading/topics/changes/changes-26_9_0.adoc with the == Breaking changes preamble from changes-template.adoc and the entry below. Leave out the Notable / Deprecated / Removed sections — those get added when something needs them, rather than shipped as <TODO> stubs.

=== Admin client `organizations.findOne` no longer rejects when the organization does not exist
// https://github.com/keycloak/keycloak/pull/51717

The `organizations.findOne` method in the `@keycloak/keycloak-admin-client` package now resolves to `undefined` when the organization does not exist, instead of rejecting with a 404 error.
Its declared return type changes from `OrganizationRepresentation` to `OrganizationRepresentation | undefined`.

This aligns the method with the equivalent lookups on other resources, such as `groups.findOne`, `roles.findOneById`, and `clients.findOne`, which already resolve to `undefined` for a missing entity.

After upgrading, code that relies on a rejected promise to detect a missing organization no longer takes that path.
TypeScript users see a compilation error wherever the result is used without a check.
Plain JavaScript users receive `undefined` instead of an error, and may only observe the change at a later point in their code.

Replace any handling that catches a 404 from this method with a check for `undefined`:

[source,typescript]
----
const organization = await adminClient.organizations.findOne({ id });

if (!organization) {
  // handle the missing organization
}
----

2. Wire it into docs/documentation/upgrading/topics/changes/changes.adoc, above the existing 26.8.0 block:

=== Migrating to 26.9.0

include::changes-26_9_0.adoc[leveloffset=2]

For precedent, both changes-26_8_0.adoc and changes-26_7_0.adoc were created by ordinary feature PRs rather than by release tooling, so opening the file as part of this task matches how it is normally done.

Activity

  1. added
    area/docs
    area/admin/client-js
    on Sep 30, 2026
  2. self-assigned this
    on Sep 30, 2026
  3. added theissue type on Oct 1, 2026
  4. added 2 commits that reference this issue on Oct 1, 2026
    670f1f0
    f1b7477
  5. added a commit that references this issue on Oct 5, 2026
    e846059
  6. added a commit that references this issue on Oct 22, 2026
    3c0ded1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area/admin/client-jsarea/docskind/taskrelease/27.0.0team/core-iam

Type

Fields

No fields configured for task.

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions