fixed in 10.0.2
This sure looks like a bug to me (Mathematica 10.0.0, MacOS):
(Local) In[345]:= s = SparseArray[{}, {20}, 1]
(Local) Out[345]= SparseArray[< 0 >, {20}, 1]
(Local) In[346]:= s // Normal
(Local) Out[346]= {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}
(Local) In[347]:= s[[All]] = 1; s
(Local) Out[347]= SparseArray[< 0 >, {20}]
(Local) In[348]:= s // Normal
(Local) Out[348]= {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
Apparently when I assigned 1 to all elements of s, it correctly realized that everything was still equal to the default, so left everything unspecified. But it incorrectly lost the 1 default value and changed the array to have the default default value of 0.
This is a toy example, but it comes out of a more complicated example in which it is causing me a serious problem. I don't know the full scope of the problem, but it is not necessary to assign to the entire array for the default value to be lost. I guess the lesson is that non-zero defaults are fragile.
Is this really a bug, or am I missing something obvious?
data = Table[1, {20}];s = SparseArray[data]; s[[All]] = 1; s // Normal
and now it is ok. $\endgroup$data = Table[1, {20}]; s = SparseArray[data, Automatic, 1]; s[[All]] = 1; s // Normal
, where the SparseArray is created with default 1. The same problem occurs. $\endgroup$