Redo edited subresource (and resource) saving in a much more simplified way.
I think this should work (unless I am missing something) and be faster than what is there.
It should also supersede #55885.
I am not 100% entirely convinced that this approach works, but I think it should so please test.
(cherry picked from commit 9eb5f2a0d79fb761235e77d369ee2f38fceb094a)