From e69ca8915ec31a8234a31beb6402108bc6cf925a Mon Sep 17 00:00:00 2001 From: Hetu Nandu Date: Fri, 30 Aug 2024 17:22:07 +0530 Subject: [PATCH 1/4] fix: Intercom setting anonymous user a common user id (#36017) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Description Avoids setting the `user_id` field in intercom when the user is not logged in Fixes https://github.com/appsmithorg/appsmith-ee/issues/5003 ## Automation /ok-to-test tags="@tag.Sanity" ### :mag: Cypress test results > [!IMPORTANT] > 🟣 🟣 🟣 Your tests are running. > Tests running at: > Commit: 1eaad316f8da84f0e99b92842f1dddc177d252c5 > Workflow: `PR Automation test suite` > Tags: `@tag.Sanity` > Spec: `` >
Fri, 30 Aug 2024 11:26:34 UTC ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No ## Summary by CodeRabbit - **New Features** - Enhanced user information handling for improved privacy in the application. - Anonymous users will no longer have their usernames processed, ensuring greater data protection. - **Bug Fixes** - Refined logic for extracting user information to prevent exposure of sensitive data. - **Documentation** - Updated comments and documentation to reflect changes in user data handling and privacy measures. --- app/client/src/utils/bootIntercom.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/app/client/src/utils/bootIntercom.ts b/app/client/src/utils/bootIntercom.ts index 34e65c6d2515..e742f1d39b31 100644 --- a/app/client/src/utils/bootIntercom.ts +++ b/app/client/src/utils/bootIntercom.ts @@ -1,4 +1,4 @@ -import type { User } from "constants/userConstants"; +import { ANONYMOUS_USERNAME, type User } from "constants/userConstants"; import { getAppsmithConfigs } from "ee/configs"; import { sha256 } from "js-sha256"; import { getLicenseKey } from "ee/utils/licenseHelpers"; @@ -7,9 +7,12 @@ const { appVersion, cloudHosting, intercomAppID } = getAppsmithConfigs(); export default function bootIntercom(user?: User) { if (intercomAppID && window.Intercom) { - let { email, username } = user || {}; - let name; - if (!cloudHosting) { + let name: string | undefined = user?.name; + let email: string | undefined = user?.email; + let username = + user?.username === ANONYMOUS_USERNAME ? undefined : user?.username; + if (!cloudHosting && username) { + // We are hiding their information when self-hosted username = sha256(username || ""); // keep email undefined so that users are prompted to enter it when they reach out on intercom email = undefined; From bf5d73a020bf76f3ef5e782a13f50889f47b9396 Mon Sep 17 00:00:00 2001 From: Abhijeet <41686026+abhvsn@users.noreply.github.com> Date: Fri, 30 Aug 2024 18:54:19 +0530 Subject: [PATCH 2/4] chore: Add admin email for installation complete event even if the user opt out of product updates (#35980) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Description PR to add admin email and domain hash if the user opts out of product updates and track subscription in a separate variable. Fixes https://github.com/appsmithorg/appsmith/issues/35658 /test Sanity ### :mag: Cypress test results > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: > Commit: 08ad5157d76f8ced94cc40fdf65f1a94c1697300 > Cypress dashboard. > Tags: `@tag.Sanity` > Spec: >
Thu, 29 Aug 2024 10:33:04 UTC ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No ## Summary by CodeRabbit - **New Features** - Improved handling of user information during the newsletter sign-up process, ensuring that user email and name are always captured for analytics. - **Bug Fixes** - Removed conditional logic that previously set user email and name to empty strings if the newsletter was not opted into, enhancing data accuracy. --- .../com/appsmith/server/solutions/ce/UserSignupCEImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/solutions/ce/UserSignupCEImpl.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/solutions/ce/UserSignupCEImpl.java index 931d850e7ab9..75133d866d02 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/solutions/ce/UserSignupCEImpl.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/solutions/ce/UserSignupCEImpl.java @@ -440,8 +440,8 @@ private Mono sendInstallationSetupAnalytics( final String instanceId = tuple.getT1(); final String ip = tuple.getT2(); log.debug("Installation setup complete."); - String newsletterSignedUpUserEmail = userFromRequest.isSignupForNewsletter() ? user.getEmail() : ""; - String newsletterSignedUpUserName = userFromRequest.isSignupForNewsletter() ? user.getName() : ""; + String newsletterSignedUpUserEmail = user.getEmail(); + String newsletterSignedUpUserName = user.getName(); Map analyticsProps = new HashMap<>(); analyticsProps.put(DISABLE_TELEMETRY, !userFromRequest.isAllowCollectingAnonymousData()); analyticsProps.put(SUBSCRIBE_MARKETING, userFromRequest.isSignupForNewsletter()); From bdeeea5c77bfa39f039256b76c90786f02f83f56 Mon Sep 17 00:00:00 2001 From: NandanAnantharamu <67676905+NandanAnantharamu@users.noreply.github.com> Date: Fri, 30 Aug 2024 20:05:41 +0530 Subject: [PATCH 3/4] test: fix inline editing spec (#35986) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit RCA: Toggle state of the property was going to wrong state, hence with retry test was passing as it would bring back the application to required statee. Solution: Updated toggle state in the flaky test to avoid this issue EE PR: https://github.com/appsmithorg/appsmith-ee/pull/4997 /ok-to-test tags="@tag.Sanity" > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: > Commit: b63e5716203e0865ad493b1bc0ab8e952aaa7301 > Cypress dashboard. > Tags: `@tag.Sanity` > Spec: >
Fri, 30 Aug 2024 14:27:24 UTC ## Summary by CodeRabbit - **New Features** - Enhanced inline editing functionality for table widgets, improving interaction and validation in tests. - **Bug Fixes** - Updated limited tests configuration to prioritize inline editing tests over previous specifications. - **Tests** - Improved test coverage for inline editing by adding interactions with dropdowns and property state toggling. --- .../Widgets/TableV2/Inline_editing_3_spec.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/Inline_editing_3_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/Inline_editing_3_spec.js index 22b09155681a..40da3f138e35 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/Inline_editing_3_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/Inline_editing_3_spec.js @@ -3,7 +3,9 @@ const widgetsPage = require("../../../../../locators/Widgets.json"); import { agHelper, table as tableHelper, + propPane, } from "../../../../../support/Objects/ObjectsCore"; +import { PROPERTY_SELECTOR } from "../../../../../locators/WidgetLocators"; describe( "Table widget inline editing functionality", @@ -161,7 +163,12 @@ describe( it("6. should check that onsubmit event is available for the columns that are editable", () => { cy.openPropertyPane("tablewidgetv2"); cy.editColumn("step"); - cy.wait(500); + cy.get(commonlocators.changeColType).last().click(); + cy.get(tableHelper._dropdownText) + .children() + .contains("Plain text") + .click(); + propPane.TogglePropertyState("Editable", "Off", ""); [ { columnType: "URL", @@ -206,8 +213,7 @@ describe( .contains(data.columnType) .click(); cy.wait("@updateLayout"); - cy.wait(500); - cy.get(".t--property-control-onsubmit").should(data.expected); + cy.get(PROPERTY_SELECTOR.onSubmit).should(data.expected); }); cy.get(propPaneBack).click(); @@ -262,8 +268,7 @@ describe( .contains(data.columnType) .click(); cy.wait("@updateLayout"); - cy.wait(500); - cy.get(".t--property-control-onsubmit").should(data.expected); + cy.get(PROPERTY_SELECTOR.onSubmit).should(data.expected); }); }); From b3c79f04ec5b5b81dd2d01f4e111b70e8c4b5f5d Mon Sep 17 00:00:00 2001 From: Sagar Khalasi Date: Fri, 30 Aug 2024 22:26:30 +0530 Subject: [PATCH 4/4] test: Fix mockdb flaky test case (#35959) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Description Fix the flaky test case with latest update. **Problem :** Whenever the Mock DBs are getting corrupted, we see flaky behaviours. As per the solution, we are running reset script every day. We can not increase the frequency as in a day time lot of testing pipelines are running it. Most of the time we see failure at two places, 1. Query from Mock Mongo DB 2. Failure in afterEach run. **Solution:** We need to remove flaky test cases part. 1. For mongo DB case, test till here so we can test connection at least as mentioned by one of developer. `dataSources.ValidateNSelectDropdown("Command", "Find document(s)");`. 2. Remove afterEach code as it is actually no required as we use new setup for each new run. **Relevant threads:** 1. https://theappsmith.slack.com/archives/C0134BAVDB4/p1724317643564089?thread_ts=1724216243.067959&cid=C0134BAVDB4 2. https://theappsmith.slack.com/archives/C02GAUE9P5H/p1712038530288709?thread_ts=1712020398.128169&cid=C02GAUE9P5H Fixes #`35136` ## Automation /ok-to-test tags="@tag.Sanity" ### :mag: Cypress test results > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: > Commit: 660b710bde7ca5c2d3998d86ce15753ac7c4c2bf > Cypress dashboard. > Tags: `@tag.Sanity` > Spec: >
Fri, 30 Aug 2024 14:07:14 UTC ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [x] No ## Summary by CodeRabbit - **Bug Fixes** - Streamlined test cases for mock database validations, improving performance and efficiency. - Removed unnecessary cleanup operations post-test execution, simplifying the testing process. - **Chores** - Updated the test specification path to prioritize sanity testing of mock databases over regression testing. --- .../e2e/Sanity/Datasources/MockDBs_Spec.ts | 42 ------------------- 1 file changed, 42 deletions(-) diff --git a/app/client/cypress/e2e/Sanity/Datasources/MockDBs_Spec.ts b/app/client/cypress/e2e/Sanity/Datasources/MockDBs_Spec.ts index e2cfb5c47e50..33f132d7aa93 100644 --- a/app/client/cypress/e2e/Sanity/Datasources/MockDBs_Spec.ts +++ b/app/client/cypress/e2e/Sanity/Datasources/MockDBs_Spec.ts @@ -74,49 +74,7 @@ describe( assertHelper.AssertNetworkStatus("@trigger"); dataSources.ValidateNSelectDropdown("Command", "Find document(s)"); - agHelper.Sleep(2000); //for movies collection to load & populate in dropdown - dataSources.ValidateNSelectDropdown("Collection", "movies"); - dataSources.RunQueryNVerifyResponseViews(1, false); - AppSidebar.navigate(AppSidebarButton.Data); - dataSources - .getDatasourceListItemDescription(mockDBName) - .then(($queryCount) => - expect($queryCount).to.eq("1 queries in this app"), - ); - - entityExplorer.CreateNewDsQuery(mockDBName); - dataSources.ValidateNSelectDropdown("Command", "Find document(s)"); - dataSources.ValidateNSelectDropdown("Collection", "movies"); - dataSources.RunQueryNVerifyResponseViews(1, false); - AppSidebar.navigate(AppSidebarButton.Data); - dataSources - .getDatasourceListItemDescription(mockDBName) - .then(($queryCount) => - expect($queryCount).to.eq("2 queries in this app"), - ); }); }); - - afterEach(() => { - AppSidebar.navigate(AppSidebarButton.Editor); - PageLeftPane.switchSegment(PagePaneSegment.Queries); - entityExplorer.ActionContextMenuByEntityName({ - entityNameinLeftSidebar: "Query1", - action: "Delete", - entityType: entityItems.Query, - }); - entityExplorer.ActionContextMenuByEntityName({ - entityNameinLeftSidebar: "Query2", - action: "Delete", - entityType: entityItems.Query, - }); - AppSidebar.navigate(AppSidebarButton.Data); - dataSources - .getDatasourceListItemDescription(dsName) - .then(($queryCount) => - expect($queryCount).to.eq("No queries in this app"), - ); - dataSources.DeleteDatasourceFromWithinDS(dsName); - }); }, );