Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F32902680
D15462.1768191931.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D15462.1768191931.diff
View Options
diff --git a/lib/shared/farcaster/farcaster-api.js b/lib/shared/farcaster/farcaster-api.js
--- a/lib/shared/farcaster/farcaster-api.js
+++ b/lib/shared/farcaster/farcaster-api.js
@@ -28,6 +28,11 @@
assertWithValidator,
} from '../../utils/validation-utils.js';
+export const notAuthorizedToViewPendingInvitesError =
+ 'Not authorized to view pending invites';
+export const notAuthorizedToAccessConversationError =
+ 'Not authorized to access this conversation';
+
export type SendFarcasterTextMessageInput =
| {
+groupId: string,
@@ -387,13 +392,20 @@
);
return result;
} catch (error) {
+ const message = getMessageForException(error);
+ const isError = !message?.includes(
+ notAuthorizedToViewPendingInvitesError,
+ );
+ const logType = isError
+ ? [logTypes.FARCASTER, logTypes.ERROR]
+ : [logTypes.FARCASTER];
addLog(
'Farcaster API: Failed to fetch conversation invites',
JSON.stringify({
conversationId: input.conversationId,
error: getMessageForException(error),
}),
- new Set([logTypes.FARCASTER, logTypes.ERROR]),
+ new Set(logType),
);
throw error;
}
diff --git a/lib/shared/farcaster/farcaster-hooks.js b/lib/shared/farcaster/farcaster-hooks.js
--- a/lib/shared/farcaster/farcaster-hooks.js
+++ b/lib/shared/farcaster/farcaster-hooks.js
@@ -13,6 +13,8 @@
type FetchFarcasterConversationInvitesInput,
type FetchFarcasterConversationInvitesResult,
type FetchFarcasterConversationResult,
+ notAuthorizedToViewPendingInvitesError,
+ notAuthorizedToAccessConversationError,
useFetchFarcasterConversation,
useFetchFarcasterConversationInvites,
useFetchFarcasterInbox,
@@ -223,8 +225,8 @@
}
const notRetryableErrors = [
- 'Not authorized to view pending invites',
- 'Not authorized to access this conversation',
+ notAuthorizedToViewPendingInvitesError,
+ notAuthorizedToAccessConversationError,
];
async function withRetry<T>(
@@ -419,7 +421,7 @@
} catch (error) {
const messageForException = getMessageForException(error);
if (
- messageForException?.includes('Not authorized to view pending invites')
+ messageForException?.includes(notAuthorizedToViewPendingInvitesError)
) {
// This is normal for many Farcaster group conversations
return null;
@@ -483,15 +485,6 @@
conversationInviteesResult?.result?.invites ?? [],
);
const fids = thread.members.map(member => member.id);
-
- if (fids.length === 0 && addLog) {
- addLog(
- 'Farcaster: No members (FIDs) found in conversation',
- JSON.stringify({ conversationID }),
- new Set([logTypes.FARCASTER]),
- );
- }
-
const commFCUsersForFIDs = await fetchUsersByFIDs(fids);
if (commFCUsersForFIDs.size !== fids.length && addLog) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Jan 12, 4:25 AM (8 h, 55 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5921317
Default Alt Text
D15462.1768191931.diff (2 KB)
Attached To
Mode
D15462: [lib] Make the logs less noisy
Attached
Detach File
Event Timeline
Log In to Comment