Skip to content

[OP-19965] Fix 500 when initializing an occurrence on a draft recurring meeting template - #24772

Open
jtauschl wants to merge 1 commit into
opf:devfrom
jtauschl:fix/recurring-meeting-init-draft-template-crash
Open

[OP-19965] Fix 500 when initializing an occurrence on a draft recurring meeting template#24772
jtauschl wants to merge 1 commit into
opf:devfrom
jtauschl:fix/recurring-meeting-init-draft-template-crash

Conversation

@jtauschl

@jtauschl jtauschl commented Aug 14, 2026

Copy link
Copy Markdown

Ticket

https://community.openproject.org/wp/OP-19965

Summary

InitOccurrenceService#draft_template_failure returned only a message with no errors:, which crashed the API layer's ErrorBase.create_and_merge_errors(call.errors) with an ArgumentError ("expected at least one error") when it tried to build a MultipleErrors response from an empty error list. Every recurring meeting's template is in draft state right after creation, so initializing its first occurrence before moving the template out of draft always hit this 500 instead of a clean 422.

Change

Populate the recurring meeting's own errors object before returning failure, matching the errors: shape used elsewhere in this service and across the codebase.

Test plan

  • Added a regression spec asserting service_result.errors is non-empty on the draft-template path, alongside the existing message/result expectations
  • Verified live against a real 17.7.1 instance: before the fix, init on a fresh recurring meeting's draft template → 500; after the fix → 422 ("The meeting series template is still in draft mode.")

…template

InitOccurrenceService#draft_template_failure returned only a message
with no errors:, which crashed the API layer's
ErrorBase.create_and_merge_errors(call.errors) with an ArgumentError
("expected at least one error") when it tried to build a MultipleErrors
response from an empty error list. Every recurring meeting's template is
in draft state right after creation, so initializing its first occurrence
before moving the template out of draft always hit this 500 instead of a
clean 422.

Populate the recurring meeting's own errors object before returning
failure, matching the errors: shape used elsewhere in this service and
across the codebase.
@github-actions

github-actions Bot commented Aug 14, 2026

Copy link
Copy Markdown

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@jtauschl

Copy link
Copy Markdown
Author

recheck

@myabc
myabc requested a lite review from Copilot August 15, 2026 18:34
@myabc myabc changed the title Fix 500 when initializing an occurrence on a draft recurring meeting template [OP-19965] Fix 500 when initializing an occurrence on a draft recurring meeting template Aug 15, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes a recurring-meeting API failure mode where initializing an occurrence on a draft meeting series template produced a 500 due to an empty ServiceResult#errors, ensuring the API layer can consistently build a validation error response (422) instead.

Changes:

  • Populate InitOccurrenceService failure results for draft templates with a non-empty errors object (via recurring_meeting.errors).
  • Add a regression spec asserting the draft-template failure path returns non-empty service_result.errors.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
modules/meeting/app/services/recurring_meetings/init_occurrence_service.rb Ensures the draft-template failure path returns a failure result with populated errors so API error merging works.
modules/meeting/spec/services/recurring_meetings/init_occurrence_service_spec.rb Adds regression coverage ensuring the draft-template failure returns non-empty errors suitable for the API layer.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants