Hence the Carney strategy up here in Canada. We can realize in hindsight that we were far too dependent on a single ally. We're diversifying - and even if America wants to become reliable again we've learned and will (hopefully) never be so dependent again.
In the post WW2 era most western countries grew lazy about sovereignty due to America's open-handed approach - this has been a wake up call and has severely lowered America's soft-power globally.
Who said we'd assume China will defend Canadian interests? The current strategy is focused on growing much closer to the EU while becoming a trade bridge for Atlantic/Pacific relations. Canada has a lot of clout on the international stage so we've been able to match-make trade linkages while expanding our market.
Canada isn't a first rate power - if the US or China decided to unilaterally target us it'd be deeply damaging. The hope is that working in concert with other middle powers we can form a cushion to soften a blow - not fully turn it.