Mexico abolished slavery by an act of Congress in 1837 (except for forced labor of natives). Texas was already an independent Republic by 1836 Treaties of Velasco.
1829 was the Guerrero Decree, which specifically exempted Tejas y Coahuila and was irrelevant since he was deposed a few weeks later.
With respect, that's quibble over trivia. Whatever specific year Mexico legally banned slavery, the handwriting was on the wall when Texas seceded. Just as the handwriting was on the wall when the Confederate states seceded from the US. Both secessions were about preserving slavery.