Repository navigation
Description
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.
Metadata
Metadata
Assignees
Labels
Type
Fields
Projects
- StatusShow more project fieldsDone
Activity
Document admin client organizations.findOne breaking change for 26.9
Document admin client organizations.findOne breaking change for 27.0
Document admin client organizations.findOne breaking change for 27.0
Document admin client organizations.findOne breaking change for 27.0