fix: V2 API returns "Booking limits must be in ascending order" due to unfiltered disabled key in interval limits transformer#28035
Open
muhammadusman586 wants to merge 2 commits intocalcom:mainfrom
Conversation
…mit transformation, with added tests
sahitya-chandra
approved these changes
Feb 18, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What does this PR do?
Fixes a bug where updating an event type via the V2 API fails with
"Booking limits must be in ascending order"whenbookingLimitsCountincludes thedisabledproperty from the BaseBookingLimitsCount_2024_06_14 DTO.Root Cause
transformIntervalLimitsApiToInternal() in interval-limits.ts iterates all
Object.entries()of the input without filtering. The BaseBookingLimitsCount_2024_06_14 class has adisabled?: boolean = falsedefault property. SinceBookingLimitsEnum_2024_06_14only mapsday,week,month,year— thedisabledkey has no mapping, producingres[undefined] = false.This corrupted object (e.g.
{ PER_DAY: 5, undefined: false }) is then passed tovalidateIntervalLimitOrder()in the TRPC update handler, which fails because"undefined"is not a recognized interval limit key.Flow:
V2 API Controller → InputEventTypesService.transformInputUpdateEventType() → transformIntervalLimitsApiToInternal({ day: 5, disabled: false }) → produces { PER_DAY: 5, undefined: false } ← BUG → validateIntervalLimitOrder() returns false → TRPCError: "Booking limits must be in ascending order"
Related Issue
#27988
Changes
apps/api/v2/.../transformers/api-to-internal/interval-limits.tsBookingLimitsEnum_2024_06_14.map()→.forEach()since the return value is unusedapps/api/v2/.../transformers/api-to-internal/api-to-internal.spec.tsdisabled: falsewith valid counts → only valid limit keys produced (noundefinedkey)disabled: true→ returns empty object{}