@ -640,10 +640,6 @@ export async function saveNewIdentity(
await databaseUtil . updateDefaultSettings ( { activeDid : identity.did } ) ;
await databaseUtil . insertDidSpecificSettings ( identity . did ) ;
// Check what was actually created
const createdSettings =
await databaseUtil . retrieveSettingsForActiveAccount ( ) ;
} catch ( error ) {
logger . error ( "Failed to update default settings:" , error ) ;
throw new Error (
@ -921,7 +917,6 @@ export async function importFromMnemonic(
derivationPath : string = DEFAULT_ROOT_DERIVATION_PATH ,
shouldErase : boolean = false ,
) : Promise < void > {
const mne : string = mnemonic . trim ( ) . toLowerCase ( ) ;
// Check if this is Test User #0
@ -946,53 +941,12 @@ export async function importFromMnemonic(
// Set up Test User #0 specific settings
if ( isTestUser0 ) {
// First, let's see what's currently in the database
const platformService = PlatformServiceFactory . getInstance ( ) ;
const existingResult = await platformService . dbQuery (
"SELECT * FROM settings WHERE accountDid = ?" ,
[ newId . did ] ,
) ;
// Let's also see the actual data by mapping it
if ( existingResult ? . values ? . length ) {
const existingData = databaseUtil . mapColumnsToValues (
existingResult . columns ,
existingResult . values ,
) [ 0 ] ;
}
// Let's also check what's in the master settings
const masterResult = await platformService . dbQuery (
"SELECT * FROM settings WHERE id = ?" ,
[ "MASTER" ] ,
) ;
// Now try the UPDATE with better debugging
const updateResult = await databaseUtil . updateDidSpecificSettings (
newId . did ,
{
firstName : "User Zero" ,
isRegistered : true ,
} ,
) ;
// Verify the settings were saved
const verifyResult = await platformService . dbQuery (
"SELECT * FROM settings WHERE accountDid = ?" ,
[ newId . did ] ,
) ;
if ( verifyResult ? . values ? . length ) {
const verifiedData = databaseUtil . mapColumnsToValues (
verifyResult . columns ,
verifyResult . values ,
) [ 0 ] ;
}
// Set up Test User #0 specific settings
await databaseUtil . updateDidSpecificSettings ( newId . did , {
firstName : "User Zero" ,
isRegistered : true ,
} ) ;
}
// Check what settings were created
const settings = await databaseUtil . retrieveSettingsForActiveAccount ( ) ;
}
/ * *