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

chore(root): Remove IS_WORKFLOW_PREFERENCES_ENABLED feature flag #6636

Merged
merged 16 commits into from
Oct 30, 2024

Conversation

SokratisVidros
Copy link
Contributor

What changed? Why was the change needed?

The feature is now released in V2, so the flag is not required anymore.

The feature is now released in V2, so the flag is not required anymore.
Copy link

github-actions bot commented Oct 7, 2024

LaunchDarkly flag references

❌ 1 flag removed

Name Key Aliases found Info
IS_WORKFLOW_PREFERENCES_ENABLED IS_WORKFLOW_PREFERENCES_ENABLED ✅ all references removed

Copy link

netlify bot commented Oct 7, 2024

Deploy Preview for novu-stg-vite-dashboard-poc ready!

Name Link
🔨 Latest commit 914f0fc
🔍 Latest deploy log https://app.netlify.com/sites/novu-stg-vite-dashboard-poc/deploys/67222bcb80709b000884ddf7
😎 Deploy Preview https://deploy-preview-6636--novu-stg-vite-dashboard-poc.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 site configuration.

Copy link
Contributor

@djabarovgeorge djabarovgeorge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, the only thing i am not sure about is the TODO we have in send message use case, do we need to convert the GetSubscriberGlobalPreferenceUsecase GetPreferences Usecase?

/*
 * TODO: Remove this after we deprecate V1 preferences, global subscriber
 * preferences are handled in `GetPreferences` for V2 preferences.
 *
 * This is actually a bug because it can allow for Global Preferences to disable
 * delivery of Workflows with read-only preferences.
 */

I think for future TODO's or Feature Flag removal we need to make sure we have a dedicated ticket in linear with more details of what the definition of done, in addition, it will help us to not think then we need to remove them as we will have it as part of the cycle

key: FeatureFlagsKeysEnum.IS_WORKFLOW_PREFERENCES_ENABLED,
})
);

/*
* TODO: Remove this after we deprecate V1 preferences, global subscriber
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rifont Can you please share more context on this? Do you see any issues with backwards compatibility between V1 and V2 after the removal of the feature flag?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We haven't performed a migration of the SubscriberPreferenceRepository into the Preferences repository (see the current lookup in get-subscriber-global-preference.usecase.ts here), therefore the current effect of this change in the absence of a migration will be that Subscribers who have modified Global Preferences will need to revisit the <Inbox /> and set their preferences again for them to become active.

Today there are 118,719 global preferences set in Prod US, all of those Subscriber preferences would not be respected without a data migration.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regarding Workflow level preferences, this change is backwards compatible because get-subscriber-template-preference.usecase.ts falls back to V1 preferences if V2 doesn't exist.

Copy link
Contributor

@rifont rifont Oct 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In summary, I suggest applying a strangler pattern here - keep the current Global Preferences lookup in place in the Send-Message usecase, then modify the get-subscriber-global-preference.usecase.ts to fetch Subscriber Global preferences with a similar fallback approach as used for Subscriber Workflow preferences.

We can then officially deprecate the V1 preferences use-cases now, and after some amount of pre-determined time, we can fully delete the V1 preference use-cases.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have applied the strangler pattern approach as listed above:

keep the current Global Preferences lookup in place in the Send-Message usecase, then modify the get-subscriber-global-preference.usecase.ts to fetch Subscriber Global preferences with a similar fallback approach as used for Subscriber Workflow preferences.

I will create a ticket for us to remove the V1 Preferences lookups in both of GetSubscriberGlobalPreference and GetSubscriberTemplatePreference, and remove this eager Global Preference lookup in SendMessage in 6 months time. That should give plenty of time for new preferences to be set so we can safely shift to V2 only Preference lookups.

Copy link

pkg-pr-new bot commented Oct 29, 2024

Open in Stackblitz

@novu/client

pnpm add https://pkg.pr.new/novuhq/novu/@novu/client@6636

@novu/framework

pnpm add https://pkg.pr.new/novuhq/novu/@novu/framework@6636

@novu/js

pnpm add https://pkg.pr.new/novuhq/novu/@novu/js@6636

@novu/headless

pnpm add https://pkg.pr.new/novuhq/novu/@novu/headless@6636

@novu/nextjs

pnpm add https://pkg.pr.new/novuhq/novu/@novu/nextjs@6636

@novu/node

pnpm add https://pkg.pr.new/novuhq/novu/@novu/node@6636

@novu/notification-center

pnpm add https://pkg.pr.new/novuhq/novu/@novu/notification-center@6636

novu

pnpm add https://pkg.pr.new/novuhq/novu@6636

@novu/providers

pnpm add https://pkg.pr.new/novuhq/novu/@novu/providers@6636

@novu/react

pnpm add https://pkg.pr.new/novuhq/novu/@novu/react@6636

@novu/react-native

pnpm add https://pkg.pr.new/novuhq/novu/@novu/react-native@6636

@novu/shared

pnpm add https://pkg.pr.new/novuhq/novu/@novu/shared@6636

commit: 914f0fc

Copy link
Contributor

@rifont rifont left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹✨🚀

@rifont rifont merged commit 92fb4e6 into next Oct 30, 2024
41 checks passed
@rifont rifont deleted the remove_feature_flag branch October 30, 2024 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants