feat: log dumps for debugging restoring accounts

some config messages are not handled correctly and we need to know why
pull/3083/head
William Grant 2 months ago
parent d4a8b555c6
commit 18ef4a62c6

@ -34,7 +34,9 @@ window.sessionFeatureFlags = {
useClosedGroupV3: false,
debug: {
debugLogging: !_.isEmpty(process.env.SESSION_DEBUG),
debugLibsessionDumps: !_.isEmpty(process.env.SESSION_DEBUG_LIBSESSION_DUMPS),
// TODO[epic=ses-825] Restore this
// debugLibsessionDumps: !_.isEmpty(process.env.SESSION_DEBUG_LIBSESSION_DUMPS),
debugLibsessionDumps: true,
debugFileServerRequests: false,
debugNonSnodeRequests: false,
debugOnionRequests: false,

@ -429,9 +429,27 @@ export class SwarmPolling {
hash: m.messageHash,
}));
if (window.sessionFeatureFlags.debug.debugLibsessionDumps) {
for (let dumpIndex = 0; dumpIndex < incomingConfigMessages.length; dumpIndex++) {
const element = incomingConfigMessages[dumpIndex];
window.log.info(
`printDumpsForDebugging: toMerge of ${dumpIndex}:${element.hash}: ${StringUtils.toHex(
element.data
)} `
);
}
}
await GenericWrapperActions.init('UserConfig', privateKeyEd25519, null);
await GenericWrapperActions.merge('UserConfig', incomingConfigMessages);
if (window.sessionFeatureFlags.debug.debugLibsessionDumps) {
window.log.info(
`printDumpsForDebugging: after merge of UserConfig:`,
StringUtils.toHex(await GenericWrapperActions.dump('UserConfig'))
);
}
const userInfo = await UserConfigWrapperActions.getUserInfo();
if (!userInfo) {
throw new Error('UserInfo not found');

Loading…
Cancel
Save