Skip to content
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

Merged
merged 6 commits into from
Oct 7, 2024

Conversation

StanGirard
Copy link
Collaborator

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.

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented hard-to-understand areas
  • I have ideally added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged

Screenshots (if appropriate):

Copy link

vercel bot commented Oct 5, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
quivrapp ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 7, 2024 10:17am

@StanGirard StanGirard requested a review from Zewed October 5, 2024 12:41
@StanGirard StanGirard marked this pull request as ready for review October 5, 2024 12:41
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. area: frontend Related to frontend functionality or under the /frontend directory labels Oct 5, 2024
brain_id: bulkMap[bulkId][0].brain_id,
datetime: bulkMap[bulkId][0].datetime,
})
localStorage.setItem("lastRetrieved", now.toString());
Copy link
Collaborator

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 :)

Copy link
Collaborator Author

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

};

const debouncedUpdateNotifications = useCallback(
// eslint-disable-next-line @typescript-eslint/no-misused-promises
Copy link
Collaborator

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

Copy link
Collaborator Author

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.
@StanGirard StanGirard merged commit fef6b2d into main Oct 7, 2024
5 checks passed
@StanGirard StanGirard deleted the fix/notification-debouncing branch October 7, 2024 10:24
StanGirard added a commit that referenced this pull request Oct 7, 2024
🤖 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).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: frontend Related to frontend functionality or under the /frontend directory size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants