Wait, aren't you studying in Shanghai? (Right now she's enrolled in a school located in Shanghai.) Wait, weren't you studying in Shanghai? (In the past she was enrolled in a school located in Shanghai.)
"but weren't/aren't you studying in Shanghai?" implies that you expected her to be in Shanghai. This does not seem to fit with the statement "I'm planning to visit a friend in Boston". I think that this problem needs to be addressed before we get to worrying about "weren't" versus "aren't".