Skip to content

[#71354] NoMethodError in Calendar::ICalController#show #22993

Open
mrmir wants to merge 1 commit intorelease/17.4from
bug/71354-nomethoderror-in-calendar-icalcontroller-show
Open

[#71354] NoMethodError in Calendar::ICalController#show #22993
mrmir wants to merge 1 commit intorelease/17.4from
bug/71354-nomethoderror-in-calendar-icalcontroller-show

Conversation

@mrmir
Copy link
Copy Markdown
Contributor

@mrmir mrmir commented Apr 29, 2026

Ticket

https://community.openproject.org/wp/71354

What are you trying to accomplish?

  • Prevent NoMethodError in Calendar::ICalController#show

What approach did you choose and why?

  • I believe the error only happens in the window between which the user is soft deleted and the actual Principals::DeleteJob runs in Users::DeleteService, which handles token deletion properly via two paths:
    • delete_associated -> delete_tokens
    • principal.destroy -> has_many :ical_tokens, class_name: "::Token::ICal", dependent: :destroy in User
  • Checking if the user exists and is active in resolve_ical_token_service makes it return a 404 straight away and prevents the 500 when user = ical_token_instance.user is reached in ICalResponseService, which returns nil for a user with status: 5, ie, deleted

Merge checklist

  • Added/updated tests
  • Added/updated documentation in Lookbook (patterns, previews, etc)
  • Tested major browsers (Chrome, Firefox, Edge, ...)

@mrmir mrmir marked this pull request as ready for review April 29, 2026 14:59
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.

1 participant