One advice I wish I had been given when I was studying this subject the first time is that you should "never ever think of a so-called heat reservoir as one that is supplying heat. Instead always think of a thermal reservoir with which thermal energy is exchanged as one that supplies entropy at a fixed and given temperature".
If you do this then you never again will ask the question when is "$dQ=TdS$"? The question is irrelevant because the reservoir supplies energy exactly $T^0dS$ along with an amount of entropy exactly $dS$ and at temperature exactly $T^0$.
@JanLalinsky has commented that the above is badly argued. Here below is an attempt to improve on it.
Why do I use the term "irrelevant"? Maybe there is a better word to describe what I am thinking of but the word "heat" as is used in a reversible process adds nothing to the understanding as to what happens, and, as I believe, obscures it. For example, we are told by most, maybe almost all books and responses here, and I was also guilty of doing so, that the word "heat" is not a noun, and at best it could/might be used in physics and specifically in thermodynamics only as a verb. But if we must use it as a noun then it means nothing but that as @BobD stated "Heat Q is energy transfer due to solely to temperature difference," or some such, and consequently and more importantly "heat" is something that cannot be stored in an equilibrium.
This question is asking about mass transfer and the ensuing heat transfer with it. Ever since the experiments of Joule, Mayer and Colding had demolished caloric theory students of thermodynamics, especially since the beginning of the 20th Century, are taught that "heat" is not something stored, so it must be moving along with the mass. (Although Kelvin clearly and strongly cautioned against that interpretation when for example he talked about latent heat, which in his view is stored in the body.)
OK, but take a moving coordinate system moving with said mass, what happens to the "heat" that is carried with the body. According to the above referenced answer one might think that is not considered heat because there is no temperature difference implied anywhere that would induce its energy exchange. What about convection that is induced by temperature difference, how do you separate strict heat exchange from mass transport, or in that case the it can be rightly viewed to be heat now as long as the motion was induced by a temperature gradient? Is it still considered heat if the motion is induced by a concentration gradient?
In fact, in a reversible process, orthodox view or not, there is no need for the concept of "heat" at all be it a noun or a verb. Entropy (or in Carnot's term calorique) is a simpler and more primitive concept than "heat" because in an isothermal and reversible process work is conserved and system entropy can be directly measured as the negative differential sensitivity, with respect to empirical temperature of the work, of the environment on the system as it is moved between two equal temperature states, say $\mathcal {A \to B}$:
$$S(\mathcal B)-S(\mathcal A)=S(\mathcal A \to \mathcal B)=-\frac{dW(\mathcal A \to \mathcal B)}{dT} \tag{1}\label{1},$$ where the temperatures of the equilibrium states $\mathcal {A, B}$ are the same as that of the thermal reservoir. This change in the system's empirical entropy is measurable by pure work and thermometric temperature measurements in the environment. Since only temperature differences are used in $\eqref{1}$, any consistent thermometric scale, not necessarily the absolute, will do.
There is nothing that the conventional concept of "heat" has that "entropy" does not have except for one thing: unlike "heat", entropy is not conserved as it moves through a passive conductor. But everything else we might expect intuitively from the noun "heat" we get it from entropy and you do not need the caloric theory of cursed memory: entropy can be stored, can be transported, (almost) additive, more in the body the higher its temperature, can do work, cannot be destroyed and is (almost) conserved.
Equation $\eqref{1}$ may be more familiar as the entropy part in the Gibbs-Helmholtz equation: $W(\mathcal A \to \mathcal B)-T\frac{dW(\mathcal A \to \mathcal B)}{dT}=U(\mathcal A \to \mathcal B)$ in which $U(\mathcal A \to \mathcal B)$ is the change in the internal energy during the isothermal and reversible transformation; here again there is no need for calorimetry, only work measurement and thermometry but now the empirical temperature scale is not enough, must use the absolute scale in contrast to the entropy measurement.
You do not need Clausius or Caratheodory to get entropy, you do not even need the 1st Law of energy conservation including calorimetric heat but you need to know how to measure empirical temperature and work. (And pace Kelvin, just replace latent heat with latent entropy.)
If you introduce entropy before the concept of "heat" then you may be free to call the stored "$TS$" piece of the total system energy $U=TS+\sum_kY_kX_k$, or the infinitesimal energy $TdS$ that is between bodies exchanged/transported as "heat" as part of the total energy change $dU=TdS+\sum_kY_kdX_k$, and no harm will be done. Calling "$TS$" heat will not make it an indestructible fluid a la the caloric theory, in fact, it will change according to the process the body is engaged in, as it happens in every Carnot cycle, for example.
In a Carnot cycle, work is done against stored energy, specifically against free energy during the isothermal steps, and against stored/absorbed $TS$ by the process in which the total entropy of the system, stored and absorbed, is moved through the gradient between the high and low temperature reservoirs during the adiabatic steps. This gives work in a reversible process: thermal energy is absorbed, used and rejected. Work is obtained as the result of entropy moving from high temperature to a lower temperature but total entropy stays the same, unchanged, if the process is reversible; entropy is indestructible.
This already is too long and it would take at least this much to discuss how and why in an irreversible process dissipation becomes a source of heat and its evolution that is fundamentally different in its origins than just another "$TS$" from somewhere else.