-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(notifications): added a debouncing mechanism #3327
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
frontend/lib/context/NotificationsProvider/notifications-provider.tsx
Outdated
Show resolved
Hide resolved
frontend/lib/context/NotificationsProvider/notifications-provider.tsx
Outdated
Show resolved
Hide resolved
frontend/lib/context/NotificationsProvider/notifications-provider.tsx
Outdated
Show resolved
Hide resolved
brain_id: bulkMap[bulkId][0].brain_id, | ||
datetime: bulkMap[bulkId][0].datetime, | ||
}) | ||
localStorage.setItem("lastRetrieved", now.toString()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tu peux set lastRetrieves dans une const vu que c'est repris plus bas :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ici l'objectif c'est de faire en sorte que dans n'importe quelle endroit du code qui fait appel à updateNotifs ca soit commun. Il y a plusieurs endroits qui font appel à la fonction
frontend/lib/context/NotificationsProvider/notifications-provider.tsx
Outdated
Show resolved
Hide resolved
}; | ||
|
||
const debouncedUpdateNotifications = useCallback( | ||
// eslint-disable-next-line @typescript-eslint/no-misused-promises |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
est-ce qu'on peut faire en sorte de pas comment avec des disable d'eslint ? ca peut causer des soucis
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
J'ai mis car ca va sauter avec le KMS. C'est un hot fix :)
The NotificationsProvider component in the frontend/lib/context/NotificationsProvider/notifications-provider.tsx file has been refactored to improve performance. The fetchNotifications function now handles errors more efficiently by returning an empty array if there is an error. Additionally, the debounce function has been optimized to cancel the existing timeout if it exists. These changes enhance the performance and reliability of the NotificationsProvider component.
4519a74
to
756fcf4
Compare
756fcf4
to
b4fce43
Compare
🤖 I have created a release *beep* *boop* --- ## 0.0.320 (2024-10-07) ## What's Changed * Enable Porter Application cdp by @porter-deployment-app in #3306 * Enable Porter Application cdp-front by @porter-deployment-app in #3307 * feat(assistant): cdp by @StanGirard in #3305 * feat: Add debug logging for OCR results by @StanGirard in #3309 * feat: Update OCR image scale for better accuracy by @StanGirard in #3310 * feat: Update PDFGenerator to include logo in header by @StanGirard in #3311 * feat: structlog parseable by @AmineDiro in #3312 * Revert "feat: structlog parseable" by @StanGirard in #3313 * feat: structlog parseable by @AmineDiro in #3314 * Revert "feat: structlog parseable" by @StanGirard in #3315 * feat: Update PDFGenerator to include logo in header by @StanGirard in #3318 * feat: structlog parseable by @AmineDiro in #3319 * feat: Update knowledge status and send notification on task success by @StanGirard in #3320 * feat: Update text retranscription instructions by @StanGirard in #3321 * feat: update sentry by @StanGirard in #3326 * chore: Remove unnecessary assertion in create_modification_report function by @StanGirard in #3329 * chore: Add NEXT_PUBLIC_INTERCOM_APP_ID to Dockerfile by @StanGirard in #3330 * feat: Update Content Security Policy for PostHog by @StanGirard in #3331 * fix(cdp): order naming cdc_etiquette by @StanGirard in #3333 * fix(notifications): added a debouncing mechanism by @StanGirard in #3327 **Full Changelog**: v0.0.319...v0.0.320 --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Description
Please include a summary of the changes and the related issue. Please also include relevant motivation and context.
Checklist before requesting a review
Please delete options that are not relevant.
Screenshots (if appropriate):