I'm a student that started doing CS research not too long ago, and I'd like some advice on making sure I'm in good terms with my peers. I've been helping another student's project (in my field, the first author is usually the author. I was to be the second author because it wasn't my project, but I'm also very interested in this research direction), but I feel that my contributions are not appreciated, and I'm often blamed for bad results. Just as an illustration, one such situation is, when I come up with an idea (e.g. finding algorithms, relevant papers that we can use in our research), the other student would pretend as if they knew about it already and tries to explain it to me as if I've never heard of it before, and takes credit. Then when I implement that idea as we discussed, s/he seems happy with it, but later when it turns out to be not exactly what we wanted (either another slightly different method performed better or his/her advisor didn't like it), I'm blamed for introducing that problem.
And I also feel that, while I'm interested in solving the same problem, I want to approach in a different way (s/he wouldn't accept it in our current project for reasons like, there are other more important things we should be working on, and so on. and I can't argue much because it's not my project). I understand that I shouldn't simply victimize myself, and it could be a different story from someone else's perspective, but regardless, I think I started seeing how there are politics in academia and how researchers can act petty and selfish, and I want to avoid that as much as possible and focus on having fun doing research and growing my career.
If I wanted to leave a project and do similar research in my own ways, is there a wise way to do this without accidentally taking credit for anything I didn't do or giving the impression that I'm trying to steal the research? I would simply cite the work we did together if there was a paper, but there is no publication yet because we couldn't finish on time, and I don't really see it being completed this way. In addition, we found out recently that there are other papers that solve this problem or part of this problem in a very similar way. I could take a significantly different direction for solving a different problem under different assumptions, but I can also see that backfiring and giving the wrong impression.
What are some potential source of unwanted politics/conflicts that beginning researchers should be aware of in general?
If you've observed students that ended up not being able to collaborate well, what was your perspective, and what did they seem to be forgetting?
If you've had conflicts or ended up not being in good terms with another researcher, how did it affect your career, if it had a long term effect?