Skip to content

YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context

fix(onboarding): stop asking managed deployments where they heard about us (#6306)

Louis Beaumontb6add454c109
diff --git a/COVERAGE.md b/COVERAGE.md
index d632f61a0..b2a568d65 100644
--- a/COVERAGE.md
+++ b/COVERAGE.md
@@ -18,14 +18,14 @@ results and `cargo llvm-cov` data on top when judging release confidence.
### Tauri E2E
-- Mapped specs: 116
-- Declared test blocks: 333
-- Weighted coverage points: 260.8
+- Mapped specs: 117
+- Declared test blocks: 334
+- Weighted coverage points: 261.3
| Platform | Specs | Declared tests | Weighted points | Layers | Features | Critical score |
| --- | --- | --- | --- | --- | --- | --- |
| windows | 89 | 288 | 235.3 | 15 | 93 | 92% |
-| macos | 112 | 296 | 231.6 | 17 | 97 | 90% |
+| macos | 113 | 297 | 232.1 | 17 | 99 | 90% |
| linux | 79 | 248 | 206.0 | 14 | 89 | 88% |
### Core Engine
diff --git a/apps/screenpipe-app-tauri/app/onboarding/page.test.tsx b/apps/screenpipe-app-tauri/app/onboarding/page.test.tsx
index c3ac8bf40..e661645ed 100644
--- a/apps/screenpipe-app-tauri/app/onboarding/page.test.tsx
+++ b/apps/screenpipe-app-tauri/app/onboarding/page.test.tsx
@@ -363,6 +363,35 @@ describe("enterprise onboarding authentication", () => {
expect(screen.queryByText("plan selection")).not.toBeInTheDocument();
});
+ // Regression: acquisition asks which marketing channel the user arrived from.
+ // A managed deployment has no such channel — an administrator pushed the
+ // install — so asking both lengthens an IT rollout and files those installs
+ // under a channel they never came from. It shipped unfiltered and stayed that
+ // way for over a week, because the only check that objected was a desktop E2E
+ // nobody could read through the other red jobs.
+ it("does not ask managed onboarding where it heard about screenpipe", async () => {
+ mocks.enterprisePolicy.isManagedAuthenticated = true;
+
+ render(<OnboardingPage />);
+
+ await waitFor(() =>
+ expect(mocks.setOnboardingStep).toHaveBeenCalledWith("permissions"),
+ );
+ expect(mocks.setOnboardingStep).not.toHaveBeenCalledWith("acquisition");
+ });
+
+ // A device that saved mid-acquisition on an older build still has to grant
+ // permissions, so it resumes there rather than skipping ahead to the engine.
+ it("resumes a managed install saved on acquisition at permissions", async () => {
+ onboardingData.currentStep = "acquisition";
+
+ render(<OnboardingPage />);
+
+ expect(
+ await screen.findByRole("button", { name: "finish permissions" }),
+ ).toBeInTheDocument();
+ });
+
it("does not collect payment from an existing cardless trial", async () => {
mocks.enterprisePolicy.isManagedDeployment = false;
mocks.settings.user = {
@@ -444,6 +473,10 @@ describe("enterprise onboarding authentication", () => {
},
);
+ // The point of this one is that a verified credential advances at all. It
+ // asserted "acquisition" for as long as the managed flow asked which
+ // marketing channel the device came from, so the destination was wrong and
+ // the unit test agreed with it. Only the desktop E2E objected.
it("advances after either enterprise credential is verified", async () => {
mocks.enterprisePolicy.authenticationState = "authenticated";
mocks.enterprisePolicy.isManagedAuthenticated = true;
@@ -451,7 +484,7 @@ describe("enterprise onboarding authentication", () => {
render(<OnboardingPage />);
await waitFor(() =>
- expect(mocks.setOnboardingStep).toHaveBeenCalledWith("acquisition"),
+ expect(mocks.setOnboardingStep).toHaveBeenCalledWith("permissions"),
);
});
diff --git a/apps/screenpipe-app-tauri/app/onboarding/page.tsx b/apps/screenpipe-app-tauri/app/onboarding/page.tsx
index 421f5c3d3..63268ba11 100644
--- a/apps/screenpipe-app-tauri/app/onboarding/page.tsx
+++ b/apps/screenpipe-app-tauri/app/onboarding/page.tsx
@@ -202,10 +202,16 @@ export default function OnboardingPage() {
() =>
SLIDE_ORDER.filter(
(s) =>
+ // Nobody on a managed deployment "heard about" screenpipe: their
+ // administrator pushed it. Asking anyway adds a step to an IT
+ // rollout and files those installs under a marketing channel they
+ // never came from, so the attribution this step exists to collect is
+ // worse for having been asked.
+ (s !== "acquisition" || !isManagedDeployment) &&
(s !== "timeline" || timelineChoiceVisible) &&
(s !== "plan" || shouldShowPlanSelection),
),
- [shouldShowPlanSelection, timelineChoiceVisible],
+ [isManagedDeployment, shouldShowPlanSelection, timelineChoiceVisible],
);
// Read by the hydration-gated restore effect below. Assigned during render,
// per the ref-mirror rule in CLAUDE.md.
@@ -270,10 +276,15 @@ export default function OnboardingPage() {
// A saved step must not resume onto a slide that this device or its
// managed policy is no longer eligible to see.
const mappedSlide =
- (mapped === "timeline" && !timelineChoiceVisibleRef.current) ||
- (mapped === "plan" && !shouldShowPlanSelection)
- ? "engine"
- : mapped;
+ mapped === "acquisition" && isManagedDeployment
+ ? // A managed install saved mid-acquisition, from a build that
+ // still asked, resumes at the step that follows it rather than
+ // at the engine: permissions still have to be granted.
+ "permissions"
+ : (mapped === "timeline" && !timelineChoiceVisibleRef.current) ||
+ (mapped === "plan" && !shouldShowPlanSelection)
+ ? "engine"
+ : mapped;
setCurrentSlide(mappedSlide);
}
}