The old saying “politics makes strange bedfellows” is no obvious, alive and mystifying than in Russia and China. It works like this. Russia has long preyed on China and much of far eastern Russia has Chinese claims on it. Yet China is not currently pursuing those claims as it is on its Indian border and in the South China Sea. Russian nukes keeps China from being belligerent and Russian willingness to trade with China and share military technology keeps China friendly. The growing sanctions imposed on Russia because of attempts to rebuild the Russian Empire (in Georgia in 2008 and Ukraine since 2014) has caused an economic crisis in Russia. China is the only major economic power willing to ignore the sanctions and work with Russia. That comes at a price; providing more military tech. China won’t need this tech for long as China will eventually pull ahead of Russia, as it has already done in some areas. But for the moment China is willing to make nice with Russia. At the same time the Russians know that this won’t last and are even now supplying weapons to nations that China is having territorial disputes with.
India has long been a major customer for Russian weapons and is currently the largest buyer. That used to be China, but gradually China bought or stole a lot of the advanced (compared to China) military and manufacturing tech Russia had. This led Russia to stop selling most high tech gear to China. Russia and India have no territorial claims on each other and both realize that eventually they will be allies against aggressive Chinese expansion. India has respected Russian patents and military tech secrets in general via decades of license deals that enables India to build Russian tanks, warplanes and other equipment in India.
Then there is Vietnam, long (for over a thousand years) a victim of Chinese aggression. Vietnam fought several mini-wars with China in the 1970s. All were stalemates or Vietnamese losses. Now Vietnam is one of half a dozen nations threatened by Chinese claims in the South China Sea and farther north. Russia has agreed to sell advanced weapons to Vietnam, often same weapons (like Kilo class subs, anti-ship missiles and Su-30 fighters) it sold to China (and India).
China finds this Russian double-dealing discomforting, understandable and something that is not decisive. Historically Chinese leaders have believed in the effectiveness of a long-term (decades or even generations) strategy. In the long run China feels it will prevail, as it always has. The last two centuries were disastrous for China but that has happened before and China eventually made a comeback. It has happened before, it will happen again. The Chinese are certain of it.