What is known about Ulam's problem of metric spaces with isometric squares? Background
In the book Problems in Modern Mathematics, S. Ulam asks the following question:
Suppose $A$ and $B$ are metric spaces, such that $A^2$ and $B^2$ equipped with the 2-metric $d((x_1, y_1),(x_2, y_2)) = \sqrt{d(x_1, x_2)^2 + d(y_1, y_2)^2}$ are isometric. Does it follow that $A$ and $B$ must also be isometric themselves?
The answer to this general question is negative. Take for example the space of the rational numbers $\mathbb{Q}$ and the space $\mathbb{Q} \sqrt{2}$ of rational multiples of $\sqrt{2}$. These two spaces are obviously not isometric, but their squares are, isometry being just the rotation by $\frac{\pi}{4}$. See http://www.ams.org/journals/proc/1971-029-03/S0002-9939-1971-0278262-5/S0002-9939-1971-0278262-5.pdf for the proof.
Question
What is the status of this problem for slightly less general metric spaces? I am especially interested in the following cases:


*

*What is known about this problem for complete metric spaces?

*What is known for finite metric spaces?


A good survey if it exists would be more than welcome.
 A: This is known for geodesic metric spaces of finite affine dimension by a beautiful result of Alexander Lytchak and Thomas Foertsch. The de Rham decomposition theorem for metric spaces.
Geom. Funct. Anal., Vol. 18 (2008), 120-143 
Here a metric space is called affine if it is isometric to a  convex subset of a normed vector space. Given a metric space $X$ its affine rank, $rank_{aff}(X)$ is defined as the supremum over all topological dimensions of affine spaces that admit an isometric embedding into $X$. Note that $rank_{aff}(X)$  is bounded above by the topological dimension of $X$.
Lytchak and  Foertsch proved that a geodesic metric space of finite affine dimension can be uniquely written as a product $X=Y_0\times Y_1\times\ldots\times Y_k$ where $Y_0$ is a Euclidean space (possibly a point) and $Y_i$ are irreducible (i.e. can not be written as products) and different from $\mathbb R$ or a point. This of course implies the result you are asking about.
A: In this paper:
On the uniqueness problem for metric products, Glasnik Mat. 27(47) (1992), 145-158. 
By Maria Moszynska (which seems to be available for free in its entirety from google books), she notes that for compact connected metric space the result is equivalent to the analogous question for direct sums of subsets of a linear space and the last problem has been solved by Peter Gruber in 1970.
For finite metric spaces, the problem was resolved positively in:
MR1787898 (2001h:54012) 
Avgustinovich, S.(RS-NOVO-IM); Fon-Der-Flaass, D.(RS-NOVO-IM)
Cartesian products of graphs and metric spaces. (English summary) 
European J. Combin. 21 (2000), no. 7, 847–851. 
54B10 (05C99 54E35) 
