Skip to content

Fix deleted user error in schema#13681

Merged
andreslucena merged 20 commits intodevelopfrom
fix/deleted_users_in_schema
Jan 22, 2025
Merged

Fix deleted user error in schema#13681
andreslucena merged 20 commits intodevelopfrom
fix/deleted_users_in_schema

Conversation

@alecslupu
Copy link
Copy Markdown
Contributor

🎩 What? Why?

While reviewing #13666, i have accidentally entered in a meeting where the author has deleted its account, and as a result i got the classic error when the author is missing.

Additionally, I have tried to remove the duplication formed around the profile_url method.

Stacktrace
17:59:01 web.1         | ActionView::Template::Error (No route matches {:action=>"show", :controller=>"decidim/profiles", :nickname=>""}, possible unmatched constraints: [:nickname]):
17:59:01 web.1         |     1: <script type="application/ld+json">
17:59:01 web.1         |     2: <%== render_schema_org_event_meeting(meeting) %>
17:59:01 web.1         |     3: </script>
17:59:01 web.1         |   
17:59:01 web.1         | actionpack (7.0.8.4) lib/action_dispatch/journey/formatter.rb:44:in `path'
17:59:01 web.1         | actionpack (7.0.8.4) lib/action_dispatch/routing/route_set.rb:824:in `url_for'
17:59:01 web.1         | actionpack (7.0.8.4) lib/action_dispatch/routing/route_set.rb:271:in `call'
17:59:01 web.1         | actionpack (7.0.8.4) lib/action_dispatch/routing/route_set.rb:327:in `block in define_url_helper'
17:59:01 web.1         | actionpack (7.0.8.4) lib/action_dispatch/routing/routes_proxy.rb:45:in `profile_url'
17:59:01 web.1         | /home/alecslupu/Sites/decidim/redesign/decidim-core/lib/decidim/engine_router.rb:50:in `method_missing'
17:59:01 web.1         | /home/alecslupu/Sites/decidim/redesign/decidim-meetings/lib/decidim/meetings/schema_org_event_meeting_serializer.rb:72:in `organizer_user'
17:59:01 web.1         | /home/alecslupu/Sites/decidim/redesign/decidim-meetings/lib/decidim/meetings/schema_org_event_meeting_serializer.rb:48:in `organizer'
17:59:01 web.1         | /home/alecslupu/Sites/decidim/redesign/decidim-meetings/lib/decidim/meetings/schema_org_event_meeting_serializer.rb:27:in `serialize'
17:59:01 web.1         | /home/alecslupu/Sites/decidim/redesign/decidim-core/app/serializers/decidim/exporters/serializer.rb:24:in `run'
17:59:01 web.1         | /home/alecslupu/Sites/decidim/redesign/decidim-core/lib/decidim/exporters/json.rb:16:in `block in export'
17:59:01 web.1         | /home/alecslupu/Sites/decidim/redesign/decidim-core/lib/decidim/exporters/json.rb:15:in `map'
17:59:01 web.1         | /home/alecslupu/Sites/decidim/redesign/decidim-core/lib/decidim/exporters/json.rb:15:in `export'
17:59:01 web.1         | /home/alecslupu/Sites/decidim/redesign/decidim-meetings/app/helpers/decidim/meetings/meetings_helper.rb:147:in `render_schema_org_event_meeting'
17:59:01 web.1         | /home/alecslupu/Sites/decidim/redesign/decidim-meetings/app/views/decidim/meetings/meetings/_schema_org_event_meeting.html.erb:2
17:59:02 web.1         | actionview (7.0.8.4) lib/action_view/base.rb:244:in `public_send'
17:59:02 web.1         | actionview (7.0.8.4) lib/action_view/base.rb:244:in `_run'
17:59:02 web.1         | actionview (7.0.8.4) lib/action_view/template.rb:157:in `block in render'
17:59:02 web.1         | activesupport (7.0.8.4) lib/active_support/notifications.rb:208:in `instrument'
17:59:02 web.1         | actionview (7.0.8.4) lib/action_view/template.rb:361:in `instrument_render_template'
17:59:02 web.1         | actionview (7.0.8.4) lib/action_view/template.rb:155:in `render'
17:59:02 web.1         | actionview (7.0.8.4) lib/action_view/renderer/partial_renderer.rb:251:in `block in render_partial_template'
17:59:02 web.1         | activesupport (7.0.8.4) lib/active_support/notifications.rb:206:in `block in instrument'
17:59:02 web.1         | activesupport (7.0.8.4) lib/active_support/notifications/instrumenter.rb:24:in `instrument'
17:59:02 web.1         | activesupport (7.0.8.4) lib/active_support/notifications.rb:206:in `instrument'
17:59:02 web.1         | actionview (7.0.8.4) lib/action_view/renderer/partial_renderer.rb:246:in `render_partial_template'
17:59:02 web.1         | actionview (7.0.8.4) lib/action_view/renderer/partial_renderer.rb:237:in `render'
17:59:02 web.1         | actionview (7.0.8.4) lib/action_view/renderer/renderer.rb:81:in `render_partial_to_object'
17:59:02 web.1         | actionview (7.0.8.4) lib/action_view/renderer/renderer.rb:27:in `render_to_object'
17:59:02 web.1         | actionview (7.0.8.4) lib/action_view/renderer/renderer.rb:22:in `render'
17:59:02 web.1         | actionview (7.0.8.4) lib/action_view/helpers/rendering_helper.rb:37:in `block in render'
17:59:02 web.1         | actionview (7.0.8.4) lib/action_view/base.rb:270:in `in_rendering_context'
17:59:02 web.1         | actionview (7.0.8.4) lib/action_view/helpers/rendering_helper.rb:33:in `render'
17:59:02 web.1         | /home/alecslupu/Sites/decidim/redesign/decidim-meetings/app/views/decidim/meetings/meetings/_meeting.html.erb:3
17:59:02 web.1         | actionview (7.0.8.4) lib/action_view/helpers/capture_helper.rb:45:in `block in capture'
17:59:02 web.1         | actionview (7.0.8.4) lib/action_view/helpers/capture_helper.rb:209:in `with_output_buffer'
17:59:02 web.1         | actionview (7.0.8.4) lib/action_view/helpers/capture_helper.rb:45:in `capture'
17:59:02 web.1         | actionview (7.0.8.4) lib/action_view/helpers/rendering_helper.rb:101:in `_layout_for'
17:59:02 web.1         | actionview (7.0.8.4) lib/action_view/renderer/partial_renderer.rb:252:in `block (2 levels) in render_partial_template'
17:59:02 web.1         | /home/alecslupu/Sites/decidim/redesign/decidim-core/app/views/layouts/decidim/shared/_layout_item.html.erb:10

📌 Related Issues

Link your PR to an issue

Testing

  1. Using a newly created user, create a meeting
  2. Visit the meeting page
  3. Delete the user account
  4. Visit the meeting page
  5. See the error
  6. Apply patch
  7. See error is gone.

📷 Screenshots

Please add screenshots of the changes you are proposing
image

♥️ Thank you!

@alecslupu alecslupu added type: fix PRs that implement a fix for a bug no-backport Pull Requests that should not be backported labels Nov 19, 2024
github-actions[bot]
github-actions bot previously approved these changes Nov 19, 2024
github-actions[bot]
github-actions bot previously approved these changes Nov 19, 2024
greenwoodt
greenwoodt previously approved these changes Nov 26, 2024
Copy link
Copy Markdown
Member

@greenwoodt greenwoodt left a comment

Choose a reason for hiding this comment

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

👍🏽

@greenwoodt
Copy link
Copy Markdown
Member

Looks all good! Requesting a second set of eyes from @andreslucena!

@andreslucena
Copy link
Copy Markdown
Member

@alecslupu as we have other PRs changing serializers and I don't want to introduce merge conflicts with them, we'll check this one out once #13740 #13702 and #13675 are merged

github-actions[bot]
github-actions bot previously approved these changes Dec 19, 2024
github-actions[bot]
github-actions bot previously approved these changes Jan 16, 2025
@andreslucena andreslucena added this to the 0.30.0 milestone Jan 20, 2025
Copy link
Copy Markdown
Member

@andreslucena andreslucena left a comment

Choose a reason for hiding this comment

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

As this was detected with a 500 error, can you add a system spec with the example of a deleted user author for meetings and proposals? Thanks

github-actions[bot]
github-actions bot previously approved these changes Jan 21, 2025
@alecslupu
Copy link
Copy Markdown
Contributor Author

As this was detected with a 500 error, can you add a system spec with the example of a deleted user author for meetings and proposals? Thanks

@andreslucena , this should be ready for a new review.

github-actions[bot]
github-actions bot previously approved these changes Jan 21, 2025
andreslucena
andreslucena previously approved these changes Jan 21, 2025
github-actions[bot]
github-actions bot previously approved these changes Jan 21, 2025
@andreslucena
Copy link
Copy Markdown
Member

@alecslupu seems like the failing spec is relevant, can you check it out 🙏🏽 ? Thanks

@andreslucena
Copy link
Copy Markdown
Member

Merging with the only failing check of codecov

@andreslucena andreslucena merged commit c0a9d5c into develop Jan 22, 2025
@andreslucena andreslucena deleted the fix/deleted_users_in_schema branch January 22, 2025 09:51
entantoencuanto added a commit that referenced this pull request Jan 24, 2025
* develop: (30 commits)
  Change hardcoded english in seeds (#13917)
  Allow importing accountability results from a Proposals component (#13817)
  Remove user interests (#13910)
  Move remaining categories from some resources to taxonomies (#13838)
  Fix translation issue on import projects mailer (#13894)
  Update DownloadYourData exports for decidim-debates (#13895)
  Allow admins to publish the questions' answers in surveys (#13786)
  Fix flaky spec in autocomplete (#13901)
  Refine taxonomy filters (part 2) (#13725)
  Fix single attachment with title (#13795)
  Fix incorrect breadcrumb encoding on mobile and tablet (#13891)
  Add string for unpublish survey admin log message (#13890)
  Fix ux meeting date location (#13872)
  New Crowdin updates (#13767)
  Fix deleted user error in schema (#13681)
  Remove assembly types from user interaction (#13881)
  Remove participatory process types from user interaction (#13880)
  Lock concurrent-ruby to 1.3.4 (#13879)
  Fix taxonomy serialization for export/imports (#13857)
  Adjust form upload label changes (#13836)
  ...
antopalidi pushed a commit to openpoke/decidim that referenced this pull request Feb 12, 2025
* Fix deleted user error in schema

* Fix failing specs

* Remove method override

* Refactor

* Fix specs

* Refactor page serializer

* Fix specs on meetings and proposals

* Add specs for blogs and debates

* Fix debates spec

* Fix spec
andreslucena pushed a commit that referenced this pull request Mar 3, 2025
* Fix deleted user error in schema

* Fix failing specs

* Remove method override

* Refactor

* Fix specs

* Refactor page serializer

* Fix specs on meetings and proposals

* Add specs for blogs and debates

* Fix debates spec

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

Projects

No open projects
Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants