Compare commits

...

1 Commits

Author SHA1 Message Date
Gilad Resisi
d220ff956b fix(youtube): stop swallowing channel-list errors in pages()
Let a failed channels.list propagate like the Facebook provider does, so
the error reaches Sentry instead of being turned into an empty list. The
continue-integration dialog already catches the failed request and shows
the same "no channels found" state.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017gsRv3MWm5YFweP58FM31H
2026-09-29 13:14:53 +07:00

View File

@ -333,30 +333,25 @@ export class YoutubeProvider extends SocialAbstract implements SocialProvider {
client.setCredentials({ access_token: accessToken });
const youtubeClient = youtube(client);
try {
// Get all channels the user has access to
const response = await youtubeClient.channels.list({
part: ['snippet', 'contentDetails', 'statistics'],
mine: true,
});
// Get all channels the user has access to
const response = await youtubeClient.channels.list({
part: ['snippet', 'contentDetails', 'statistics'],
mine: true,
});
const channels = response.data.items || [];
const channels = response.data.items || [];
return channels.map((channel) => ({
id: channel.id!,
name: channel.snippet?.title || 'Unnamed Channel',
picture: {
data: {
url: channel.snippet?.thumbnails?.default?.url || '',
},
return channels.map((channel) => ({
id: channel.id!,
name: channel.snippet?.title || 'Unnamed Channel',
picture: {
data: {
url: channel.snippet?.thumbnails?.default?.url || '',
},
username: channel.snippet?.customUrl || '',
subscriberCount: channel.statistics?.subscriberCount || '0',
}));
} catch (error) {
console.error('Failed to fetch YouTube channels:', error);
return [];
}
},
username: channel.snippet?.customUrl || '',
subscriberCount: channel.statistics?.subscriberCount || '0',
}));
}
async fetchPageInformation(accessToken: string, data: { id: string }) {