/session API call SPAM from <Inbox /> component after upgrade
Hi all! I'm developing a web application and using Novu as a notification provider. We implemented the <Inbox /> component inside the app successfully, and everything was working properly with version 2.6.6. Recently, I upgraded the @novu/react version to 3.5.0, and since then, the <Inbox /> component spams a session call on every render (I'm sure it's the <Inbox /> component, as I tried removing it and the issue disappeared).
The issue appears when adding any customization to the component. With <Inbox subscriberId={XXX} applicationIdentifier={XXX} />, the component works fine, but when a customization is added (even just the appearance property), the component starts spamming /session requests.
Any help?
5 Replies
@MasterFish
I am checking this from our end, Could you please share the react version you are using?
Sure! currently using react 18.2.0
@MasterFish
Could you please share your exact customization?
I tried to reproduce with this basic one
I see. The issue seems to be related to navigation through a client-side router — in my case, react-router-dom. The <Inbox /> component is placed inside a header component that remains the same across all pages of the app. The structure is similar to:
<div>
<Inbox />
<Outlet /> {/* from react-router-dom */}
</div>
The session spam is triggered when changing the app’s path, i.e., navigating from one page to another. Doing so triggers between 1 and 4 API calls, even though each /session call returns a 201 success response. This strange behaviour did not occur using @novu/react version 2.6.6@MasterFish
I tried to reproduce this with novu react 3.5.0 with minimal example, but could not reproduce this
https://github.com/jainpawan21/novu-react-3.5.0-with-react-router
Could you please check the implementation and share the minimal reproducible code in the form of repo?