N
Novu•2mo ago
VJR

Workflow disappears from preferences after toggling in React component

We're using 0.24.2 of the React component along with workflows which have tags assigned. We use these tags along with a preferenceFilter function on the PopoverNotificationCenter to control the visibility of workflow preferences. What we've noticed is that, as soon as a preference is toggled, the workflow disappears from the preference list. During debugging, we noticed that the workflow data returned by the PATCH request that updates the preference does not contain a tags property. It seems like this data is merged into the component's state, deleting the tags and then causing the workflow to no longer pass our filter function. The fact that the PATCH response is missing data about the workflow feels like a bug on the Novu API side.
6 Replies
Pawan Jain
Pawan Jain•2mo ago
Thanks for sharing the bug, We will look into it is 0.24.2 the version of @novu/notification-center package?
VJR
VJROP•3w ago
HI Pawan, yes, that's the package 👋 wondering if this has been investigated yet?
VJR
VJROP•3w ago
Found the cause of the bug. This PR caused /v1/widgets/preferences/<workflow-id> to stop returning workflow tags https://github.com/novuhq/novu/commit/55adc3843a6aae86ebe262bf0c1d8a043281adbb#diff-3ce0a4d681f04e6c776bec4cbb4d92d331057c6a7a6e08267e1322f9a793c018R488
VJR
VJROP•3w ago
Actually there are multiple places in that PR where workflow tags aren't returned, the correct one for the widgets endpoint is https://github.com/novuhq/novu/commit/55adc3843a6aae86ebe262bf0c1d8a043281adbb#diff-78125a604dd4965407be0dfdcec322b56392a315f1183a872d1b271629525992R466
VJR
VJROP•3w ago
Reported here https://github.com/novuhq/novu/issues/7254 along with a simple patch that should at least begin to fix the problem.
GitHub
Bug Report: PATCH /v1/widgets/preferences/ doesn't return workflow ...
I'm submitting a... bug report feature request question about the decisions made in the repository question about how to use this project Summary PATCH /v1/widgets/preferences/<workflow-id&g...
Pawan Jain
Pawan Jain•3w ago
@VJR I will look into this on priority Thanks for the issue

Did you find this page helpful?