Multisite site_root_id - Questionable behavior on record deletion

Hi, I am experimenting with the Multisite Feature. I added the multisite trait to a custom model and site_id and site_root_id to its table. I also set $propagatableSync to true. I have two Sites US and EU

When I create a record in US it gets created in EU too.
And site_root_id gets set to the id of the US record for both records.
As expected.

Now if I switch to EU and delete the EU record, only this record gets deleted.
But if I delete the US record, EU gets deleted as well.

Example:

Let’s say I create and publish a blog post in US. Then I adapt the propagated EU posts content and publish it.

Now the US and EU posts behave differently on deletion: If I delete the US post, the EU post will get deleted too. But if I delete the EU post, the US post will still exist.

I really don’t see a use case for this different behavior of two blog posts (or whatever) on the same topic. I mean yes, it’s useful to be able, to delete a post (or whatever record) on all (or even selected) sites at once. But shouldn’t this be independent on the question, which of the posts was the original? Many times one wouldn’t even remember - and look up the site_root_id to identify the original.

Yes, they belong together. And being able to access them by some handle like site_root_id is a very important feature. But wouldn’t it be much better, if this handle would be independent of the (existence of) the original record?

Why not on deletion of the original record update the site_root_id of the remaining record(s) to one of the record ids of the remaining record(s). Or even introduce a common handle which is independent of the record ids?

btw: For attribute propagation there is no special treatment of the original record:
It doesn’t matter if I update a propagatable field in EU or US. In both cases the changed value propagates to the other record. Luckily. Was already afraid, that it would only propagate from the original record to the propagated and not vice versa :wink:

Yes, agreed, it should probably sync deletes in both directions.

With sync delete you mean that whenever one deletes a record from a group (=sharing the same_site_root_id), all records in the group should get deleted?

Sometimes this may be wanted, but equally likely one may want to delete only the current record - no matter whether it is the original record or a copy.

This would be sync: false / multisite: true, where records are synchronized manually. Toggling between sites in this mode prompts the user to create a record, and likewise deleting a record doesn’t affect the group.

1 Like