/.diff Secret
Created
February 25, 2025 08:18
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/lib/hooks/latest-message-edit.js b/lib/hooks/latest-message-edit.js | |
index 59832456bf..5e021ffcec 100644 | |
--- a/lib/hooks/latest-message-edit.js | |
+++ b/lib/hooks/latest-message-edit.js | |
@@ -63,7 +63,7 @@ function useBaseGetLatestMessageEdit(): ( | |
} | |
if (originalMessage.id !== messageID) { | |
- console.log('last related message is not original message'); | |
+ console.trace(`last related message ${messageID} is not original message ${originalMessage.id} in threadID ${originalMessage.threadID}, ${JSON.stringify(relatedMessages)}`); | |
return undefined; | |
} | |
diff --git a/lib/hooks/message-hooks.js b/lib/hooks/message-hooks.js | |
index b3875eab5b..b1fa809b84 100644 | |
--- a/lib/hooks/message-hooks.js | |
+++ b/lib/hooks/message-hooks.js | |
@@ -133,6 +133,7 @@ function useMessageInfoForPreview(threadInfo: ThreadInfo): ?MessageInfo { | |
} | |
setCanFetchOlderMessages(false); | |
void (async () => { | |
+ console.log(`fetching older messages for ${threadInfo.id}`); | |
await fetchMessages({ numMessagesToFetch: shouldFetchOlderMessages }); | |
await sleep(3000); | |
setCanFetchOlderMessages(true); | |
diff --git a/lib/selectors/chat-selectors.js b/lib/selectors/chat-selectors.js | |
index ebf1138210..945cb2bd3b 100644 | |
--- a/lib/selectors/chat-selectors.js | |
+++ b/lib/selectors/chat-selectors.js | |
@@ -90,6 +90,25 @@ function useGetChatThreadItemLoader(): ThreadInfo => ChatThreadItemLoader { | |
const sidebarInfos = useSidebarInfos(); | |
const messageStore = useSelector(state => state.messageStore); | |
const getLastUpdatedTimes = useGetLastUpdatedTimes(); | |
+ | |
+ const values = React.useMemo( | |
+ () => ({ | |
+ sidebarInfos, | |
+ messageStore, | |
+ getLastUpdatedTimes, | |
+ }), | |
+ [sidebarInfos, messageStore, getLastUpdatedTimes], | |
+ ); | |
+ const prevValues = React.useRef(values); | |
+ if (values !== prevValues.current) { | |
+ console.log({ | |
+ sidebarInfos: values.sidebarInfos !== prevValues.current.sidebarInfos, | |
+ messageStore: values.messageStore !== prevValues.current.messageStore, | |
+ getLastUpdatedTimes: values.getLastUpdatedTimes !== prevValues.current.getLastUpdatedTimes, | |
+ }); | |
+ prevValues.current = values; | |
+ } | |
+ | |
return React.useCallback( | |
threadInfo => { | |
const mostRecentNonLocalMessage = getMostRecentNonLocalMessageID( | |
@@ -212,6 +231,21 @@ function useChatThreadItemLoaders( | |
threadInfos: $ReadOnlyArray<ThreadInfo>, | |
): $ReadOnlyArray<ChatThreadItemLoader> { | |
const getChatThreadItemLoader = useGetChatThreadItemLoader(); | |
+ const values = React.useMemo( | |
+ () => ({ | |
+ getChatThreadItemLoader, | |
+ threadInfos, | |
+ }), | |
+ [getChatThreadItemLoader, threadInfos], | |
+ ); | |
+ const prevValues = React.useRef(values); | |
+ if (values !== prevValues.current) { | |
+ console.log({ | |
+ getChatThreadItemLoader: values.getChatThreadItemLoader !== prevValues.current.getChatThreadItemLoader, | |
+ threadInfos: values.threadInfos !== prevValues.current.threadInfos, | |
+ }); | |
+ prevValues.current = values; | |
+ } | |
return React.useMemo( | |
() => threadInfos.map(getChatThreadItemLoader), | |
[threadInfos, getChatThreadItemLoader], | |
diff --git a/lib/shared/messages/reaction-message-spec.js b/lib/shared/messages/reaction-message-spec.js | |
index da18f8bcfd..f27a17336c 100644 | |
--- a/lib/shared/messages/reaction-message-spec.js | |
+++ b/lib/shared/messages/reaction-message-spec.js | |
@@ -33,6 +33,10 @@ import { ET } from '../../utils/entity-text.js'; | |
import { threadIsGroupChat } from '../thread-utils.js'; | |
import { hasMinCodeVersion } from '../version-utils.js'; | |
+let i = 0; | |
+let j = 0; | |
+let k = 0; | |
+ | |
export const reactionMessageSpec: MessageSpec< | |
ReactionMessageData, | |
RawReactionMessageInfo, | |
@@ -212,6 +216,7 @@ export const reactionMessageSpec: MessageSpec< | |
const { action } = rawMessageInfo; | |
const { notifTargetUserID, fetchMessageInfoByID } = params; | |
+ console.log(`fetching target of reaction ${rawMessageInfo.id} in threadID ${rawMessageInfo.threadID} for getMessageNotifyType ${i++}`); | |
const targetMessageInfo = await fetchMessageInfoByID( | |
rawMessageInfo.targetMessageID, | |
); | |
@@ -236,6 +241,7 @@ export const reactionMessageSpec: MessageSpec< | |
messageInfo: ReactionMessageInfo, | |
params: ShowInMessagePreviewParams, | |
) => { | |
+ console.log(`fetching target of reaction ${messageInfo.id} in threadID ${messageInfo.threadID} for showInMessagePreview ${j++}`); | |
const originalMessage = await params.fetchMessage( | |
messageInfo.targetMessageID, | |
); | |
@@ -251,6 +257,7 @@ export const reactionMessageSpec: MessageSpec< | |
params: ShowInMessagePreviewParams, | |
) => | |
async () => { | |
+ console.log(`fetching target of reaction ${rawMessageInfo.id} in threadID ${rawMessageInfo.threadID} for getLastUpdatedTime ${k++}`); | |
const originalMessage = await params.fetchMessage( | |
rawMessageInfo.targetMessageID, | |
); | |
diff --git a/lib/shared/sidebar-item-utils.js b/lib/shared/sidebar-item-utils.js | |
index 259d435d65..ab152ce7ed 100644 | |
--- a/lib/shared/sidebar-item-utils.js | |
+++ b/lib/shared/sidebar-item-utils.js | |
@@ -135,6 +135,7 @@ async function getCandidateSidebarItemsForThreadList( | |
} else if (sidebarInfos.length <= maxUnreadSidebars + 1) { | |
return await getAllFinalSidebarItems(sidebarInfos); | |
} | |
+ console.log('calling getCandidateSidebarItemsForThreadList'); | |
const loaders = sidebarInfos.map(sidebar => ({ | |
threadInfo: sidebar.threadInfo, | |
diff --git a/native/.babelrc.cjs b/native/.babelrc.cjs | |
index f1a4a9bf12..c2a84cacd2 100644 | |
--- a/native/.babelrc.cjs | |
+++ b/native/.babelrc.cjs | |
@@ -16,9 +16,4 @@ module.exports = { | |
}, | |
], | |
], | |
- env: { | |
- production: { | |
- plugins: ['transform-remove-console'], | |
- }, | |
- }, | |
}; | |
diff --git a/native/chat/chat-thread-list.react.js b/native/chat/chat-thread-list.react.js | |
index 903830c80e..653ba7cc12 100644 | |
--- a/native/chat/chat-thread-list.react.js | |
+++ b/native/chat/chat-thread-list.react.js | |
@@ -121,10 +121,12 @@ function ChatThreadList(props: BaseProps): React.Node { | |
React.useEffect(() => { | |
void (async () => { | |
+ console.log(`${route.name} loading more items ${numItemsToDisplay}`); | |
const results = | |
await chatThreadItemLoaderCache.loadMostRecentChatThreadItems( | |
numItemsToDisplay, | |
); | |
+ console.log(`${route.name} done loading more items`); | |
setBoundChatListData(results); | |
})(); | |
}, [numItemsToDisplay, chatThreadItemLoaderCache]); | |
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 7a5f737231..01e5e8c857 100644 | |
--- a/native/redux/redux-setup.js | |
+++ b/native/redux/redux-setup.js | |
@@ -63,6 +63,7 @@ import { getDevServerHostname } from '../utils/url-utils.js'; | |
function reducer(state: AppState = defaultState, inputAction: Action) { | |
let action = inputAction; | |
+ console.log(action.type); | |
if (action.type === setReduxStateActionType) { | |
return action.payload.state; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment