Skip to content

Revert "fix(cloud): stop bouncing working users to /cloud/survey mid-session"#12344

Merged
dante01yoon merged 1 commit into
mainfrom
revert-12301-deep/fix-survey-gate-false-positives
May 19, 2026
Merged

Revert "fix(cloud): stop bouncing working users to /cloud/survey mid-session"#12344
dante01yoon merged 1 commit into
mainfrom
revert-12301-deep/fix-survey-gate-false-positives

Conversation

@deepme987
Copy link
Copy Markdown
Contributor

@deepme987 deepme987 commented May 19, 2026

Reverts #12301

┆Issue is synchronized with this Notion page by Unito

@deepme987 deepme987 requested a review from a team May 19, 2026 22:06
@dosubot dosubot Bot added the size:S This PR changes 10-29 lines, ignoring generated files. label May 19, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 19, 2026

Review Change Stack

📝 Walkthrough

Walkthrough

This PR inverts the failure semantics of getSurveyCompletedStatus(): non-OK HTTP responses and exceptions now return false (not completed) instead of true (completed), with the associated test suite removed.

Changes

Survey completion failure handling

Layer / File(s) Summary
Survey completion failure semantics
src/platform/cloud/onboarding/auth.ts
getSurveyCompletedStatus() now treats non-OK responses (404, 500, etc.) as "not completed" (false) with an info Sentry breadcrumb, and catches network/parse exceptions returning false instead of true. The test file src/platform/cloud/onboarding/auth.test.ts validating the old behavior is removed.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

  • Comfy-Org/ComfyUI_frontend#12301: Both PRs modify getSurveyCompletedStatus() in opposite directions; this PR returns false on non-OK/exception, while the other returns true.

Suggested labels

size:S, cloud/1.44

Suggested reviewers

  • DrJKL

Poem

🐰 When surveys fail to load, dear friend,
Treat them as incomplete, not the end,
No more "true" when networks break the chain—
False is kinder, simpler, plain.
Hop along with clearer errors' song! 🌿

🚥 Pre-merge checks | ✅ 6 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description is minimal and lacks required sections from the template (Summary, Changes, Review Focus). Add a proper summary section explaining why the revert is necessary, detail what changes were reverted in the Changes section, and highlight any review focus points or breaking changes.
✅ Passed checks (6 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: reverting a previous fix that affected survey gating behavior.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
End-To-End Regression Coverage For Fixes ✅ Passed PR is a revert operation (title: "Revert 'fix(...)'), not a bug-fix. The check targets bug-fix PRs that should include E2E tests; reverts don't trigger this requirement.
Adr Compliance For Entity/Litegraph Changes ✅ Passed PR modifies only cloud authentication files; no changes to litegraph, ECS, or graph entity structures. Check does not apply.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch revert-12301-deep/fix-survey-gate-false-positives

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 19, 2026

🎨 Storybook: ✅ Built — View Storybook

Details

⏰ Completed at: 05/19/2026, 10:08:08 PM UTC

Links

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 19, 2026

🎭 Playwright: ✅ 1626 passed, 0 failed · 1 flaky

📊 Browser Reports
  • chromium: View Report (✅ 1605 / ❌ 0 / ⚠️ 1 / ⏭️ 5)
  • chromium-2x: View Report (✅ 2 / ❌ 0 / ⚠️ 0 / ⏭️ 0)
  • chromium-0.5x: View Report (✅ 1 / ❌ 0 / ⚠️ 0 / ⏭️ 0)
  • mobile-chrome: View Report (✅ 18 / ❌ 0 / ⚠️ 0 / ⏭️ 0)

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
src/platform/cloud/onboarding/auth.ts (1)

99-99: ⚡ Quick win

Remove newly added inline narrative comments.

These comments restate nearby logic and add maintenance noise; prefer self-describing control flow instead.

As per coding guidelines, "Avoid new usage of code comments; do not add or retain redundant comments".

Also applies to: 112-112, 115-115

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/platform/cloud/onboarding/auth.ts` at line 99, Remove the redundant
inline narrative comments (e.g. "// Not an error case - survey not completed is
a valid state" and the similar comments at the other noted locations) so the
control flow is self-describing; delete those comment lines around the
onboarding/auth logic (the newly added inline comments at the three spots) and
ensure no other redundant explanatory comments remain — rely on clear
variable/branch naming instead.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/platform/cloud/onboarding/auth.ts`:
- Around line 98-109: The current survey status check treats any non-OK HTTP
response or exception as "survey incomplete" by returning false; change this to
only return false for explicit API signals of incompletion and return true for
unexpected failures. Specifically, in the block that calls the onboarding
settings endpoint (references: ONBOARDING_SURVEY_KEY, response, and
Sentry.addBreadcrumb) update the non-OK branch to log the event but return true
(not false) unless the response body explicitly indicates incomplete; likewise
adjust the catch/exception branch (the later block around the second Sentry
breadcrumb) to return true on unexpected errors, and only return false when the
API payload explicitly marks the survey as incomplete. Ensure both places
consistently treat transient/network errors as pass-through (true) instead of
failing closed.

---

Nitpick comments:
In `@src/platform/cloud/onboarding/auth.ts`:
- Line 99: Remove the redundant inline narrative comments (e.g. "// Not an error
case - survey not completed is a valid state" and the similar comments at the
other noted locations) so the control flow is self-describing; delete those
comment lines around the onboarding/auth logic (the newly added inline comments
at the three spots) and ensure no other redundant explanatory comments remain —
rely on clear variable/branch naming instead.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 6854f3ac-6987-4f7c-afc2-10348e808729

📥 Commits

Reviewing files that changed from the base of the PR and between 64c75bf and 0335326.

📒 Files selected for processing (2)
  • src/platform/cloud/onboarding/auth.test.ts
  • src/platform/cloud/onboarding/auth.ts
💤 Files with no reviewable changes (1)
  • src/platform/cloud/onboarding/auth.test.ts

Comment on lines 98 to +109
if (!response.ok) {
// Ambiguous response (404/5xx/etc). Treat as completed to avoid
// bouncing working customers to /cloud/survey on transient hiccups.
// Real "not completed" only comes from a 200 with empty value.
// Not an error case - survey not completed is a valid state
Sentry.addBreadcrumb({
category: 'auth',
message: 'Survey status check returned non-ok response',
level: 'warning',
level: 'info',
data: {
status: response.status,
endpoint: `/settings/${ONBOARDING_SURVEY_KEY}`
}
})
return true
return false
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Fail-closed return values reintroduce false-positive survey gating.

Returning false on every non-OK response and exception treats transient failures as "survey not completed". That can bounce already-onboarded users back into survey flow when the status check is temporarily unavailable. Keep false only for explicit "incomplete" signals from the API; return true for unexpected failures.

Suggested adjustment
     if (!response.ok) {
+      if (response.status === 404) {
+        return false
+      }
       Sentry.addBreadcrumb({
         category: 'auth',
         message: 'Survey status check returned non-ok response',
         level: 'info',
         data: {
           status: response.status,
           endpoint: `/settings/${ONBOARDING_SURVEY_KEY}`
         }
       })
-      return false
+      return true
     }
@@
   } catch (error) {
@@
-    return false
+    return true
   }

Also applies to: 114-127

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/platform/cloud/onboarding/auth.ts` around lines 98 - 109, The current
survey status check treats any non-OK HTTP response or exception as "survey
incomplete" by returning false; change this to only return false for explicit
API signals of incompletion and return true for unexpected failures.
Specifically, in the block that calls the onboarding settings endpoint
(references: ONBOARDING_SURVEY_KEY, response, and Sentry.addBreadcrumb) update
the non-OK branch to log the event but return true (not false) unless the
response body explicitly indicates incomplete; likewise adjust the
catch/exception branch (the later block around the second Sentry breadcrumb) to
return true on unexpected errors, and only return false when the API payload
explicitly marks the survey as incomplete. Ensure both places consistently treat
transient/network errors as pass-through (true) instead of failing closed.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 19, 2026

Codecov Report

❌ Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/platform/cloud/onboarding/auth.ts 0.00% 2 Missing ⚠️
@@             Coverage Diff             @@
##             main   #12344       +/-   ##
===========================================
- Coverage   74.16%   59.79%   -14.38%     
===========================================
  Files        1521     1411      -110     
  Lines       87335    72130    -15205     
  Branches    24400    20016     -4384     
===========================================
- Hits        64774    43127    -21647     
- Misses      21736    28530     +6794     
+ Partials      825      473      -352     
Flag Coverage Δ
e2e ?
unit 59.79% <0.00%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/platform/cloud/onboarding/auth.ts 0.00% <0.00%> (-24.45%) ⬇️

... and 1012 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@dante01yoon dante01yoon added needs-backport Fix/change that needs to be cherry-picked to the current feature freeze branch core/1.44 Backport PRs for core 1.44 cloud/1.44 Backport PRs for cloud 1.44 and removed core/1.44 Backport PRs for core 1.44 labels May 19, 2026
@deepme987 deepme987 enabled auto-merge May 19, 2026 22:37
@dante01yoon dante01yoon disabled auto-merge May 19, 2026 22:58
@dante01yoon dante01yoon merged commit 2ab1abb into main May 19, 2026
75 of 78 checks passed
@dante01yoon dante01yoon deleted the revert-12301-deep/fix-survey-gate-false-positives branch May 19, 2026 22:58
@comfy-pr-bot
Copy link
Copy Markdown
Member

@deepme987 Successfully backported to #12346

@github-actions github-actions Bot removed the needs-backport Fix/change that needs to be cherry-picked to the current feature freeze branch label May 19, 2026
dante01yoon pushed a commit that referenced this pull request May 20, 2026
… to /cloud/survey mid-session" (#12346)

Backport of #12344 to `cloud/1.44`

Automatically created by backport workflow.

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-12346-backport-cloud-1-44-Revert-fix-cloud-stop-bouncing-working-users-to-cloud-survey-m-3656d73d365081a2bd91ce5002af5fdc)
by [Unito](https://www.unito.io)

Co-authored-by: Deep Mehta <42841935+deepme987@users.noreply.github.com>
@comfy-pr-bot comfy-pr-bot added the released:cloud PR has been released to cloud label May 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cloud/1.44 Backport PRs for cloud 1.44 released:cloud PR has been released to cloud size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants