Skip to content

Instantly share code, notes, and snippets.

@Ashoat

Ashoat/.diff Secret

Created July 6, 2024 21:35
Show Gist options
  • Save Ashoat/4ac8c57b3359b5a33fb8ee10268ada90 to your computer and use it in GitHub Desktop.
Save Ashoat/4ac8c57b3359b5a33fb8ee10268ada90 to your computer and use it in GitHub Desktop.
diff --git a/lib/actions/user-actions.js b/lib/actions/user-actions.js
index e398a744a7..17685b1327 100644
--- a/lib/actions/user-actions.js
+++ b/lib/actions/user-actions.js
@@ -939,6 +939,7 @@ function useIdentityPasswordLogIn(): (
let result;
try {
result = await identityClient.logInPasswordUser(username, password);
+ console.log('logInPasswordUser result', result);
} catch (e) {
const { registerReservedPasswordUser } = identityClient;
if (
@@ -958,6 +959,7 @@ function useIdentityPasswordLogIn(): (
message,
signature,
);
+ console.log('registerReservedPasswordUser result', result);
}
try {
await markPrekeysAsPublished();
diff --git a/lib/hooks/thread-search-hooks.js b/lib/hooks/thread-search-hooks.js
index bbc8f83209..c17545c796 100644
--- a/lib/hooks/thread-search-hooks.js
+++ b/lib/hooks/thread-search-hooks.js
@@ -44,6 +44,7 @@ function useThreadListSearch(
return;
}
+ console.log('usernamePrefix', usernamePrefix);
const { userInfos } = await legacyCallSearchUsers(usernamePrefix);
filterAndSetUserResults(userInfos);
},
diff --git a/lib/reducers/user-reducer.js b/lib/reducers/user-reducer.js
index 41e35004a9..e7f28a467b 100644
--- a/lib/reducers/user-reducer.js
+++ b/lib/reducers/user-reducer.js
@@ -87,6 +87,7 @@ function reduceCurrentUserInfo(
id: action.payload.userID,
username: action.payload.username,
};
+ console.log('are we clearing username here?', action.payload);
if (!_isEqual(newUserInfo)(state)) {
return newUserInfo;
}
diff --git a/lib/shared/search-utils.js b/lib/shared/search-utils.js
index 1e0ad54c86..6c227cfe67 100644
--- a/lib/shared/search-utils.js
+++ b/lib/shared/search-utils.js
@@ -431,6 +431,7 @@ function useSearchUsers(
console.error(err);
}
}
+ console.log('useSearchUsers calling legacySearchUsers');
const { userInfos: keyserverSearchResult } =
await callLegacyAshoatKeyserverSearchUsers(forwardLookupSearchText);
setSearchResultsFromServer(keyserverSearchResult);
diff --git a/lib/socket/user-infos-handler.react.js b/lib/socket/user-infos-handler.react.js
index 24b3989315..aa1ff47035 100644
--- a/lib/socket/user-infos-handler.react.js
+++ b/lib/socket/user-infos-handler.react.js
@@ -26,6 +26,7 @@ export default function SocketMessageUserInfosHandler(
serverServerSocketMessageValidator,
message,
);
+ console.log('SocketMessageUserInfosHandler', newUserIDs);
if (newUserIDs.length > 0) {
dispatch({
type: processNewUserIDsActionType,
diff --git a/lib/utils/user-info-extraction-utils.js b/lib/utils/user-info-extraction-utils.js
index 565b2a0ff7..43a1eadfab 100644
--- a/lib/utils/user-info-extraction-utils.js
+++ b/lib/utils/user-info-extraction-utils.js
@@ -81,6 +81,7 @@ function extractAndPersistUserInfosFromEndpointResponse(
endpointValidators[endpoint].validator,
);
const newUserIDs = extractUserIDsFromPayload(extendedValidator, message);
+ console.log('extractAndPersistUserInfosFromEndpointResponse', endpoint, newUserIDs);
if (newUserIDs.length > 0) {
dispatch({
type: processNewUserIDsActionType,
diff --git a/native/.babelrc.cjs b/native/.babelrc.cjs
index 91b9b5df07..473d913f93 100644
--- a/native/.babelrc.cjs
+++ b/native/.babelrc.cjs
@@ -8,9 +8,9 @@ module.exports = {
// react-native-reanimated must be last
'react-native-reanimated/plugin',
],
- env: {
- production: {
- plugins: ['transform-remove-console'],
- },
- },
+ //env: {
+ // production: {
+ // plugins: ['transform-remove-console'],
+ // },
+ //},
};
diff --git a/native/components/background-identity-login-handler.react.js b/native/components/background-identity-login-handler.react.js
index ce9bd9dac2..28d3a37dcf 100644
--- a/native/components/background-identity-login-handler.react.js
+++ b/native/components/background-identity-login-handler.react.js
@@ -24,6 +24,7 @@ function BackgroundIdentityLoginHandler() {
const isAccountWithPassword = useSelector(state =>
accountHasPassword(state.currentUserInfo),
);
+ const csat = useSelector(state => state.commServicesAccessToken);
const hasAccessToken = useSelector(state => !!state.commServicesAccessToken);
const dataLoaded = useSelector(state => state.dataLoaded);
@@ -43,8 +44,11 @@ function BackgroundIdentityLoginHandler() {
!usingCommServicesAccessToken ||
loginAttemptedRef.current
) {
+ console.log({ hasAccessToken, dataLoaded, usingCommServicesAccessToken, csat, loginAttempted: loginAttemptedRef.current });
+ console.log('skipping');
return;
}
+ console.log('not skipped');
if (!isAccountWithPassword) {
handleLogOutAndAlert();
diff --git a/native/data/sqlite-data-handler.js b/native/data/sqlite-data-handler.js
index b04eb1c473..f84264438b 100644
--- a/native/data/sqlite-data-handler.js
+++ b/native/data/sqlite-data-handler.js
@@ -152,11 +152,13 @@ function SQLiteDataHandler(): React.Node {
);
const handleSensitiveData = React.useCallback(async () => {
+ console.log('starting handleSensitiveData');
try {
let sqliteStampedUserID,
errorGettingStampedUserID = false;
try {
sqliteStampedUserID = await commCoreModule.getSQLiteStampedUserID();
+ console.log(`got sqliteStampedUserID: ${sqliteStampedUserID}`);
} catch (error) {
errorGettingStampedUserID = true;
console.log(
@@ -175,6 +177,7 @@ function SQLiteDataHandler(): React.Node {
currentLoggedInUserID &&
currentLoggedInUserID !== sqliteStampedUserID
) {
+ console.log(`stamping SQLite DB with: ${currentLoggedInUserID}`);
await commCoreModule.stampSQLiteDBUserID(currentLoggedInUserID);
}
} catch (e) {
diff --git a/native/ios/Comm.xcodeproj/xcshareddata/xcschemes/Comm.xcscheme b/native/ios/Comm.xcodeproj/xcshareddata/xcschemes/Comm.xcscheme
index 1f3420bbf7..862e981bb0 100644
--- a/native/ios/Comm.xcodeproj/xcshareddata/xcschemes/Comm.xcscheme
+++ b/native/ios/Comm.xcodeproj/xcshareddata/xcschemes/Comm.xcscheme
@@ -55,7 +55,7 @@
</Testables>
</TestAction>
<LaunchAction
- buildConfiguration = "Debug"
+ buildConfiguration = "Release"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
diff --git a/native/redux/redux-setup.js b/native/redux/redux-setup.js
index feee812a2a..c779305467 100644
--- a/native/redux/redux-setup.js
+++ b/native/redux/redux-setup.js
@@ -125,6 +125,7 @@ function reducer(state: AppState = defaultState, inputAction: Action) {
action.payload.preRequestUserState,
)
) {
+ console.log('invalid session downgrade!');
return {
...state,
loadingStatuses: reduceLoadingStatuses(state.loadingStatuses, action),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment