0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-05 16:23:34 +08:00
discourse/lib/service/base
Martin Brennan ea74b65aa5
DEV: Preserve existing errors in service model steps (#41896)
`ModelStep` revalidates changed models by calling `invalid?`, which
clears errors
added by the model producer before validations run. For example,
`UploadCreator`
can return an unsaved `Upload` containing an image-processing error;
`ModelStep`
then clears that error and may treat the `Upload` as valid.

Treat models that already contain errors as invalid without revalidating
them.
This preserves operation-specific errors for `on_model_errors` while
continuing
to validate changed models that do not already contain errors.

---------

Co-authored-by: Loïc Guitaut <loic@discourse.org>
2026-07-23 17:15:26 +10:00
..
context.rb DEV: Fix isolation bugs in service framework's each step (#40311) 2026-05-27 09:47:34 +02:00
contract_step.rb
each_step.rb DEV: Fix isolation bugs in service framework's each step (#40311) 2026-05-27 09:47:34 +02:00
lock_step.rb
model_step.rb DEV: Preserve existing errors in service model steps (#41896) 2026-07-23 17:15:26 +10:00
only_if_step.rb
options_step.rb
policy_step.rb
step.rb
steps_helpers.rb
transaction_step.rb
try_step.rb