Skip to content

Commit b50d9fa

Browse files
committed
remove unused function
1 parent b77bc28 commit b50d9fa

File tree

1 file changed

+0
-63
lines changed

1 file changed

+0
-63
lines changed

index.html

Lines changed: 0 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1182,69 +1182,6 @@
11821182
}
11831183
}
11841184

1185-
async retrieveMissedMessagesFromCausalHistory(currentMessage, missingMessageIds) {
1186-
try {
1187-
// Use causal history from the current message to find retrieval hints
1188-
const causalHistory = currentMessage.causalHistory || [];
1189-
console.log(`Processing causal history with ${causalHistory.length} entries for ${missingMessageIds.length} missing messages`);
1190-
1191-
for (const missingMessageId of missingMessageIds) {
1192-
// Find retrieval hint for this missing message in causal history
1193-
const historyEntry = causalHistory.find(entry => entry.messageId === missingMessageId);
1194-
const retrievalHint = historyEntry?.retrievalHint;
1195-
1196-
console.log(`Retrieving missing message: ${missingMessageId}${retrievalHint ? ' with hint' : ' without hint'}`);
1197-
1198-
let foundMessage = false;
1199-
1200-
// Try retrieval hint first if available (hash-based query)
1201-
if (retrievalHint) {
1202-
try {
1203-
// Hash-based query - no time range
1204-
for await (const messagesPromises of this.node.store.queryGenerator(
1205-
[this.decoder],
1206-
{
1207-
messageHashes: [retrievalHint]
1208-
}
1209-
)) {
1210-
const messages = await Promise.all(messagesPromises);
1211-
1212-
for (const message of messages) {
1213-
if (message && message.payload) {
1214-
try {
1215-
const retrievedSdsMessage = decodeMessage(message.payload);
1216-
if (retrievedSdsMessage.messageId === missingMessageId) {
1217-
console.log(`Successfully retrieved ${missingMessageId} using hash query`);
1218-
1219-
// Feed the retrieved message back to SDS
1220-
this.messageChannel.receiveMessage(retrievedSdsMessage);
1221-
foundMessage = true;
1222-
break;
1223-
}
1224-
} catch (decodeError) {
1225-
console.warn('Failed to decode retrieved message:', decodeError);
1226-
}
1227-
}
1228-
}
1229-
1230-
if (foundMessage) break;
1231-
}
1232-
} catch (hintQueryError) {
1233-
console.warn(`Hash query failed for ${missingMessageId}:`, hintQueryError);
1234-
}
1235-
}
1236-
1237-
// No fallback to time-based search - hash queries only
1238-
if (!foundMessage) {
1239-
console.warn(`Could not retrieve missing message: ${missingMessageId} (no valid hash or hash query failed)`);
1240-
}
1241-
}
1242-
1243-
} catch (error) {
1244-
console.error('Failed to retrieve missed messages from causal history:', error);
1245-
}
1246-
}
1247-
12481185
handleSDSMessage(sdsMessage) {
12491186
try {
12501187
if (!sdsMessage.content || sdsMessage.content.length === 0) {

0 commit comments

Comments
 (0)