AceDB only writes settings that have been altered to the SavedVariables file. It does not write if nothing has been changed.
In your example,
defaultValue has a default of
true; you did not change it to
false,
"Ted", or
007, it is still
true. Therefore it is
nil in your SV file. Nothing is lost. In fact, it retains the default value from
PROFILE_DEFAULTS in memory.
BTW, here's a tip: change this line. This will create a literal profile called
Default in the Profiles options tree when presented to the user. You will see what I mean when you load into the game. It makes the life of the user a lot easier.
Code:
self.db = LibStub("AceDB-3.0"):New("MyAddonDB", PROFILE_DEFAULTS, true) -- add true to the end
Also, using SetProfile() as I understand it (could be wrong, but based on your question...) only sets the profile name, it does not set the values of the profile being set. For that, you want CopyProfile(). In any case, if you want people to have one set of values universally upon login, see the code line above.
https://www.wowace.com/projects/ace3...api/ace-db-3-0