Skip to content

fix: add missing validation to UpdateSchedule#9874

Open
chaptersix wants to merge 2 commits intotemporalio:mainfrom
chaptersix:update-memo-size-checks
Open

fix: add missing validation to UpdateSchedule#9874
chaptersix wants to merge 2 commits intotemporalio:mainfrom
chaptersix:update-memo-size-checks

Conversation

@chaptersix
Copy link
Copy Markdown
Contributor

@chaptersix chaptersix commented Apr 8, 2026

Summary

The CHASM UpdateSchedule codepath was missing several validation checks
that exist on the V1 path and on CreateSchedule CHASM:

  • Payload size check (memo + action input): CreateSchedule CHASM validates
    this explicitly since it bypasses StartWorkflowExecution. UpdateSchedule CHASM
    had no equivalent check. Now both use a shared validateSchedulePayloadSize
    helper in the common UpdateSchedule handler, so it applies to both V1 and CHASM.

  • Request ID length check: Was only inside updateScheduleWorkflow (V1).
    Moved to the shared UpdateSchedule handler so CHASM gets it too.

  • Header size metric: Was only recorded on the V1 Update path. Now recorded
    in the shared UpdateSchedule and CreateSchedule handlers for both paths.

Also removes duplicate checks from updateScheduleWorkflow that are now
handled in the shared path, and refactors the inline blob size check in
createScheduleCHASM to use the same shared helper.

Test plan

  • TestUpdateScheduleRequestIDTooLong -- oversized request ID rejected with InvalidArgument
  • TestUpdateScheduleBlobSizeLimit -- oversized memo rejected with InvalidArgument
  • Full TestScheduleCHASM and TestScheduleV1 suites pass

@chaptersix chaptersix requested review from a team as code owners April 8, 2026 21:18
@chaptersix chaptersix force-pushed the update-memo-size-checks branch 3 times, most recently from 053e259 to 7a63764 Compare April 8, 2026 22:01
Comment thread tests/schedule_test.go Outdated
- Extract validateSchedulePayloadSize helper shared by CreateSchedule
  and UpdateSchedule (both CHASM and V1 paths)
- Move request ID length check and header size metric to shared
  UpdateSchedule handler
- Remove duplicate checks from updateScheduleWorkflow
- Add functional tests for oversized request ID and blob size limit
@chaptersix chaptersix force-pushed the update-memo-size-checks branch from 7a63764 to 01071b4 Compare April 10, 2026 19:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant