Repository navigation
Conversation
Contributor
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem statement
Root cause and evidence
FLO_MATRIX_OFFLINE=1or with partial environment setups would trigger outbound HTTP pings. Furthermore, early revisions broke offline precedence when attempting naiveNODE_ENVchecks.main/services/inventory.ts) detected stock deficits but returned generic errors without product, variant, or add-on display names attached to the structured failure detail.order-attempt.tsdid not sanitize server errors before passing them into cashier toasts and support tickets.Changes made
main/services/telemetry.ts:isTelemetrySuppressed()to evaluateFLO_MATRIX_OFFLINE=1,E2E_TASK_LOCAL_PORTS, andFLO_E2E_SKIP_OPTIONAL_NETWORK=1as strict overrides over development flags (FLO_TELEMETRY_DEV=1).test,e2e,1.0.0-test,2.7.2-test).run_mode === 'dev') from production telemetry transmission by default.main/services/cloud-sync.ts: Blocked outgoing diagnostics flushes whenisTelemetrySuppressed()is true.main/services/posthog-config.ts: Blocked PostHog transmission when offline or suppressed.main/services/inventory.ts: Enriched insufficient stock validation failures with item name, variant label, and add-on group/option names.frontend/src/lib/order-attempt.ts:sanitizeServerError()to bound error message lengths (max 200 chars) and reject stack traces, file paths, SQL fragments, and exception object dumps, substituting safe localized fallback messages.tests/helpers/test-setup.ts&tests/e2e-server.cjs: SetFLO_MATRIX_OFFLINE=1by default to ensure all local test runs remain offline.tests/telemetry-leakage-prevention.test.ts(23 assertions) and frontend E2E specs ine2e/diagnostics-checkout-recovery.spec.ts.Reproduction before the fix
sendAnonymousDiagnosticReport()in a test environment withFLO_TELEMETRY_DEV=1whileFLO_MATRIX_OFFLINE=1was set previously allowed transmission to proceed due to incorrect override evaluation order.Verification after the fix
npm run lint: 0 errors.npm run build: compile clean todist/.npm run build:frontend: Next.js 16 export clean (27/27 static pages).npm run i18n:check: 24 languages clean, exact leaf parity.npm run docs:check: markdownlint, relative links (506 checked), and policy clean.npm run test:telemetry: 100% passed.npm run test:telemetry-leakage-prevention: 100% passed (23 assertions).npm run test:diagnostics-outbox-bounds: 100% passed (570 passed, 0 failed).npm run test:diagnostics: 100% passed.npm run test:issue-788-order-attempt-storage: 100% passed.npm run test:addon-inventory-db: 100% passed (69/69).npm run test:support-ticket: 100% passed (41/41).npm run test:script-coverage: passed (241 reachable, 298 run).npx playwright test e2e/diagnostics-checkout-recovery.spec.ts e2e/diagnostics-screen.spec.ts: 17 passed (18.4s).Independent reviewer findings
isTelemetrySuppressed()properly honors offline precedence over developer overrides.2.7.2-testfixture intests/telemetry-delivery.test.tsmaintains test fixture integrity without weakening assertions.Risk assessment
Remaining limitations
FLO_MATRIX_OFFLINE=1to guarantee local isolation.Related issues and PRs
feat/diagnostics-triage-hardeningand flopos.com privacy disclosures.