Skip to content

Conversation

@Ayaanshaikh12243
Copy link

#174

  1. Reduced Polling Frequency:

// Before: 30 seconds (excessive)
const interval = setInterval(updatePresence, 30000);

// After: 2 minutes (optimized)
const interval = setInterval(updatePresence, 120000);

Copy
typescript
2. Connection Pooling Implemented:

// Shared channels instead of multiple connections
const messageChannels = new Map<number, any>();
const channelSubscribers = new Map<number, Set<() => void>>();
let sharedPresenceChannel: any = null;

Copy
typescript
3. Proper Cleanup:

// Clean up shared channel if no subscribers
if (presenceSubscribers.size === 0 && sharedPresenceChannel) {
supabase.removeChannel(sharedPresenceChannel);
sharedPresenceChannel = null;
}

Copy
typescript
4. Error Handling Added:

try {
await supabase.from('UserPresence').upsert({...});
} catch (error) {
console.warn('Failed to update presence:', error);
}

Copy
typescript
Performance Improvements:
75% less network requests (2 min vs 30 sec intervals)

Connection pooling prevents multiple channels

Memory leak prevention with proper cleanup

Error resilience with try-catch blocks

Issue #174 resolved! 🚀

@vercel
Copy link

vercel bot commented Jan 26, 2026

@Ayaanshaikh12243 is attempting to deploy a commit to the Divya Tiwari's projects Team on Vercel.

A member of the Team first needs to authorize it.

@netlify
Copy link

netlify bot commented Jan 26, 2026

Deploy Preview for tiwaridivya25-devconnect ready!

Name Link
🔨 Latest commit 8603343
🔍 Latest deploy log https://app.netlify.com/projects/tiwaridivya25-devconnect/deploys/697770fb2382420008ac74b7
😎 Deploy Preview https://deploy-preview-182--tiwaridivya25-devconnect.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions
Copy link

👋 Hi @Ayaanshaikh12243,
This pull request does not seem to be linked to an issue.

Please link an issue using one of the following formats:

Linking issues helps us track work and close issues automatically. Thanks! 🙌

@github-actions
Copy link

Thanks for creating a PR for your Issue! ☺️

We'll review it as soon as possible.
In the meantime, please double-check the file changes and ensure that all commits are accurate.

If there are any unresolved review comments, feel free to resolve them. 🙌🏼

@Ayaanshaikh12243
Copy link
Author

@TiwariDivya25 please check mam thank you

@TiwariDivya25
Copy link
Owner

@Ayaanshaikh12243 Please follow the PR template and link the issue number in the given format.

@Ayaanshaikh12243
Copy link
Author

@TiwariDivya25 mam please share the template

@Ayaanshaikh12243
Copy link
Author

@TiwariDivya25 where is the template please share mam
Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants