Hey Rob, thanks for clear summary.
- I've discussed with the team, and we think the change introduced with #2750 is correct, that is, soft-deleted relations should not be persisted on create
- Like you mentioned, we can use .fetch() or .fetchLazy() to control how far the setIncludeSoftDeletes() should propagate
I've noticed one change in how .fetchLazy() behaves, I'd like to run it by you
- Prior to 13.6.6, query.fetchLazy("account").fetchLazy("account.environment") would return all accounts and soft-deleted environments
- With 13.6.6, this no longer loads all properties in soft-deleted environments
- However, query.fetchLazy("account.environment") works without issue (loads all properties in account, and all properties in soft-deleted environments)
- Note that eager fetching does not have issues when multiple fetch paths are used
I've reproduced the issue
here, see the
fetchLazy_with_multiple_paths_does_not_fetch_deep_relations_that_are_softdeleted test case.
Q: Is this change in behaviour expected given the changes in 13.6.6?
Thanks,
Patrick