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

feat: Update NPS Value Survey #9638

Merged
merged 72 commits into from
Jun 11, 2024
Merged

feat: Update NPS Value Survey #9638

merged 72 commits into from
Jun 11, 2024

Conversation

mutdmour
Copy link
Contributor

@mutdmour mutdmour commented Jun 5, 2024

Summary

Fix and refactor value (NPS) survey to show periodically for users

Value (NPS) survey asks user to rate n8n as below, then asks if they want to share their email. It depends on calling an external service that decides whether to show survey or not. That has been broken for a long time.

(current version)
Screenshot 2024-06-06 at 10 17 23
Screenshot 2024-06-06 at 10 17 30

Now we are rebuilding it without depending on an external service. It simply periodically (every 6 months) asks user to rate n8n again (if user ignores survey, it crops up a week later at most 3 times). The response is sent through telemetry.

(updated version)
Screenshot 2024-06-06 at 10 26 16
Screenshot 2024-06-06 at 10 26 20

Related tickets and issues

Include links to Linear ticket or Github issue or Community forum post. Important in order to close automatically and provide context to reviewers.

Review / Merge checklist

  • PR title and summary are descriptive. Remember, the title automatically goes into the changelog. Use (no-changelog) otherwise. (conventions)
  • Docs updated or follow-up ticket created.
  • Tests included.

    A bug is not considered fixed, unless a test is added to prevent it from happening again.
    A feature is not complete without tests.

@mutdmour mutdmour requested a review from a team as a code owner June 5, 2024 17:12
@n8n-assistant n8n-assistant bot added core Enhancement outside /nodes-base and /editor-ui n8n team Authored by the n8n team ui Enhancement in /editor-ui or /design-system labels Jun 5, 2024
Copy link
Contributor

✅ All Cypress E2E specs passed

@netroy netroy changed the title feature: Update NPS Value Survey feat: Update NPS Value Survey Jun 10, 2024
@@ -36,7 +37,7 @@ describe('Workflow Actions', () => {
WorkflowPage.getters.isWorkflowSaved();
});

it('should not save already saved workflow', () => {
it.skip('should not save already saved workflow', () => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Please ensure that this doesn't get left in the end

Copy link
Contributor

@tomi tomi left a comment

Choose a reason for hiding this comment

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

Couple questions still but otherwise LGTM

cypress/e2e/42-nps-survey.cy.ts Outdated Show resolved Hide resolved
@@ -36,7 +37,7 @@ describe('Workflow Actions', () => {
WorkflowPage.getters.isWorkflowSaved();
});

it('should not save already saved workflow', () => {
it.skip('should not save already saved workflow', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Please ensure that this doesn't get left in the end

Comment on lines 142 to 149
try {
promptsData.value = await getPromptsData(
settingsStore.settings.instanceId,
currentUserId.value ?? '',
);
} catch (e) {
console.error('Failed to fetch prompts data');
}
Copy link
Contributor

Choose a reason for hiding this comment

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

What happens if this fails?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

nothing, but maybe the nps survey will show. n8n api might be down, but it should not affect UX and no need to show notification (we make this call too often and user does not know about it).

try {
promptsData.value = await getPromptsData(
settingsStore.settings.instanceId,
currentUserId.value ?? '',
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we even want to fetch the prompts data if currentUserId is not set? Why not skip the whole requests then? In what case might this happen? Is there a possible race condition that this is called before currentUserId has value?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, I can add this. Technically no, since specific user actions are needed to trigger this, for example save a workflow.
I think this logic predates user management so maybe that's why. We did not have user id, just instance id.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

for a long time in n8n until v1, setting up an owner user was optional, even after we added user management. so userId could be undefined but a user is logged in.

Copy link
Contributor

Choose a reason for hiding this comment

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

If it should always be defined, it would be nicer to have an assert to satisfy TS compiler and to communicate that this should always be defined when this gets called. Otherwise it can cause nasty bugs that are hard to debug (e.g. if there's a bug that this function gets always called before the currentUserId is defined the nps survey will never get initialized properly).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes that makes sense. Thanks for the suggestion

mutdmour and others added 2 commits June 11, 2024 09:32
Co-authored-by: Tomi Turtiainen <10324676+tomi@users.noreply.github.com>
@mutdmour mutdmour requested a review from tomi June 11, 2024 07:41
@mutdmour mutdmour merged commit 50bd5b9 into master Jun 11, 2024
14 of 18 checks passed
@mutdmour mutdmour deleted the ado-768 branch June 11, 2024 08:23
MiloradFilipovic added a commit that referenced this pull request Jun 11, 2024
* master:
  ci: Fix custom docker builds (no-changelog) (#9702)
  test: Fix e2e for projects missing instance owner (no-changelog) (#9703)
  ci: Refactor e2e tests to be less flaky (no-changelog) (#9695)
  feat(editor): Add move resources option to workflows and credentials on (#9654)
  fix: Introduce `HooksService` (#8962)
  fix(editor): Improve large data warning in input/output panel (#9671)
  ci(editor): Enforce type-safety in @n8n/chat builds as well (no-changelog) (#9685)
  fix(editor): Un-skip workflow save test (no-changelog) (#9698)
  refactor(core): Remove more dead code from event bus (no-changelog) (#9697)
  ci: Remove unused WaitTracker mocking (no-changelog) (#9694)
  feat: Update NPS Value Survey (#9638)
  refactor(core): Remove event bus channel (no-changelog) (#9663)
  refactor(core): Remove event bus helpers (no-changelog) (#9690)
  refactor(core): Merge event bus controllers and remove dead code (no-changelog) (#9688)
  ci: Fix e2e tests (no-changelog) (#9689)
  refactor(core): Use `@Licensed()` in event bus controller (no-changelog) (#9687)
  fix(editor): Node background for executing nodes in dark mode (#9682)
  fix(editor): Prevent saving already saved workflows (#9670)
  fix(editor): Fix node connection showing incorrect item count during … (#9684)
  refactor: Set up Cypress as pnpm workspace (no-changelog) (#6049)
MiloradFilipovic added a commit that referenced this pull request Jun 12, 2024
* master:
  fix(editor): Add back credential type icon (no-changelog) (#9704)
  feat(editor): Add canvas edge toolbar hover show/hide support (no-changelog) (#9699)
  ci: Fix custom docker builds (no-changelog) (#9702)
  test: Fix e2e for projects missing instance owner (no-changelog) (#9703)
  ci: Refactor e2e tests to be less flaky (no-changelog) (#9695)
  feat(editor): Add move resources option to workflows and credentials on (#9654)
  fix: Introduce `HooksService` (#8962)
  fix(editor): Improve large data warning in input/output panel (#9671)
  ci(editor): Enforce type-safety in @n8n/chat builds as well (no-changelog) (#9685)
  fix(editor): Un-skip workflow save test (no-changelog) (#9698)
  refactor(core): Remove more dead code from event bus (no-changelog) (#9697)
  ci: Remove unused WaitTracker mocking (no-changelog) (#9694)
  feat: Update NPS Value Survey (#9638)
  refactor(core): Remove event bus channel (no-changelog) (#9663)
  refactor(core): Remove event bus helpers (no-changelog) (#9690)
@github-actions github-actions bot mentioned this pull request Jun 12, 2024
@janober
Copy link
Member

janober commented Jun 12, 2024

Got released with n8n@1.46.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Enhancement outside /nodes-base and /editor-ui n8n team Authored by the n8n team Released ui Enhancement in /editor-ui or /design-system
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants