In the late 80s, Vietnam began to realize that the Soviet downfall is imminent. That's why it reached out to China for peace and attempted to copy China's model by opening up its economy. In the 90s, many Vietnamese returned from oversea and pro-West factions in the South is strengthened due to the focus is turning to economy. Vietnam has slowly become pro-West and anti-China become more prominent.
The story behind bad Sino-Viet relations is complicated. After the North Vietnam win and withdrawal of US forces from Vietnam, Vietnam forces started a campaign against the red Khmer's regime in Cambodia. Khmer's behind their pro-communist camouflage, was a regime supported by CIA who suppressed the real Cambodian Communists and used by US as a distraction to Vietcongs, harrasing villages in Vietnam and claiming Vietnam territories. So Vietnam undistracted (Americans left) turned full on against Khmers. That's when PRC started a low profile war against Vietnam to make them stop. My belief is that it was a tactic mistake from Chinese side turning against a real communist ally, to justify the compliance of PRC to US interests, since it was those times that Nixon and Mao got in contacts. Maybe Nixon blackmailed like "stop them, or we are not coming to invest to your free economic zones". Vietnam after the fall of the USSR suffered a lot, like every other Soviet ally, they needed bad financial assistance which they got it from IMF and Word bank, while giving up to western requirements, like stop anti west propaganda and open up the economy to foreign capital.