Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

corriger création de proche pendant prise rdv collectif par l’usager #4502

Open
sentry-sentry-incubateur-net bot opened this issue Jul 31, 2024 · 0 comments
Labels

Comments

@sentry-sentry-incubateur-net
Copy link

Le responsable est cette ligne

https://github.com/betagouv/rdv-service-public/blob/production/app/form_models/user_rdv_wizard.rb#L118

@rdv.user_ids = [attributes[:created_user_id]] if attributes[:created_user_id].present?

dans le cas d’un RDV normal (donc un new record) ça a l’effet escompté : assigner le nouveau proche au RDV en cours de prise

mais dans le cas d’un RDV collectif, donc déjà persisté, cette ligne a un autre effet non désiré : ça tente une écriture pour modifier les users du RDV 😱
Heureusement que cela échoue !

Sentry Issue: LAPINS-1DB

PG::NotNullViolation: ERROR:  null value in column "created_by_type" of relation "participations" violates not-null constraint (PG::NotNullViolation)
DETAIL:  Failing row contains (2808310, 1174747, 3630733, t, t, null, null, null, null, null, null, null, 0, unknown, 2024-07-30 12:19:09.215245, 2024-07-30 12:19:09.215245, null, null, f).

  app/form_models/user_rdv_wizard.rb:118:in `initialize'
    @rdv.user_ids = [attributes[:created_user_id]] if attributes[:created_user_id].present?
  app/controllers/users/rdv_wizard_steps_controller.rb:66:in `new'
    klass.new(current_user, request_params)
  app/controllers/users/rdv_wizard_steps_controller.rb:66:in `rdv_wizard_for'
    klass.new(current_user, request_params)
  app/controllers/users/rdv_wizard_steps_controller.rb:15:in `new'
    @rdv_wizard = rdv_wizard_for(current_user, query_params)
  config/initializers/cookie_overflow_notify.rb:10:in `call'
    @app.call(env)
...
(245 additional frame(s) were not displayed)

ActiveRecord::NotNullViolation: PG::NotNullViolation: ERROR:  null value in column "created_by_type" of relation "participations" violates not-null constraint (ActiveRecord::NotNullViolation)
DETAIL:  Failing row contains (2808310, 1174747, 3630733, t, t, null, null, null, null, null, null, null, 0, unknown, 2024-07-30 12:19:09.215245, 2024-07-30 12:19:09.215245, null, null, f).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: 🔖 Ready
Development

No branches or pull requests

0 participants