You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Zendesk custom user fields are nullable, but the type in our action's output is not. Allowing null values would've been breaking, so instead we filter out null values.
This PR fixes a type mismatch where Zendesk custom user fields can return null values from the API, but the action output schema declared them as non-nullable strings. Rather than widening the output type (which would be breaking), null entries are now filtered out before the data reaches consumers.
_zdUserSchema is extended to accept z.record(z.string().nullable()) when parsing raw Zendesk responses, then transformUser uses pickBy with a type-guard predicate to strip null-valued keys before returning the non-nullable User type.
The version is bumped from 3.1.2 to 3.1.3 to reflect the patch.
Confidence Score: 5/5
This is a small, well-scoped fix that correctly handles nullable Zendesk user fields without changing the output contract.
The change is minimal and correct: the schema extension allows null values only in the intermediate parsing layer, and the pickBy filter reliably removes them before the data is returned to callers. No existing API contract is changed.
No files require special attention.
Important Files Changed
Filename
Overview
integrations/zendesk/src/definitions/schemas.ts
Extends _zdUserSchema to accept nullable user field values from Zendesk, then filters nulls out in transformUser before returning the non-nullable output type.
integrations/zendesk/integration.definition.ts
Patch version bump from 3.1.2 to 3.1.3 to reflect the bug fix.
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["Zendesk API Response\nuser_fields: { k: string | null }"] --> B["_zdUserSchema.parse()\n(now accepts nullable values)"]
B --> C["ZendeskUser\nuser_fields: Record<string, string | null> | undefined"]
C --> D["transformUser()"]
D --> E{"user_fields\ntruthy?"}
E -- "Yes" --> F["pickBy(user_fields,\nvalue !== null)"]
F --> G["userFields: Record<string, string>\n(nulls removed)"]
E -- "No" --> H["userFields: undefined"]
G --> I["User output\nuserFields: z.record(z.string()).optional()"]
H --> I
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves BE-1330
Zendesk custom user fields are nullable, but the type in our action's output is not. Allowing null values would've been breaking, so instead we filter out null values.