Repository navigation
fix(main): close offline mode gaps across restore, updater, telemetry, and fetches - #1317
Conversation
|
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 |
|
@greptileai review this at apex |
[Medium impact] Offline mode now affects several outbound workflows across the app. Fix the updater’s acceptance of old results before merging; the other findings concern launch counts and image-request hardening. Findings
|
b9fa78f to
6dcf9e7
Compare
|
@greptileai review this at apex |
…ytics, fetches, and updater
…zation` alert in `tests/offline-mode.test.ts` (and its sibling URL-matching test interceptors in the same file): - Replaced `String(input).includes('telemetry.flopos.com')` at line 655 with an exact comparison against the exported `TELEMETRY_URL` constant (`String(input) === TELEMETRY_URL`). - Replaced `url.includes('posthog.example')` at line 291 with `new URL(String(input)).hostname === 'posthog.example'`. - Replaced `String(url).includes('/releases?')` at line 461 with `new URL(String(url)).pathname.endsWith('/releases')`. Verified with `npm run test:offline-mode` (54/54 passed), `node scripts/ci/check-changed-format.cjs --base 8a0c272`, `npm run lint`, `npm run build`, and `git diff --check`
6dcf9e7 to
118b9a4
Compare
|
@greptileai review this at apex |
Fixes #1309
Intent
Resolve all 6 Greptile second-review findings from PR #1306 (Issue #1309) and PR #1317 follow-up review threads
What Changed
offline_modeacross database restores and non-overwrite JSON imports, and addgetOfflineModeAbortSignal()to abort in-flight product image imports, tax pack catalog and artifact downloads, telemetry and diagnostic requests, and PostHog network requests when Offline mode is enabled.app_launchwhen Offline mode turns off, and block CloudSync auto-registration retries and failure-state writes while offline.offlinestate when Offline mode is enabled, track and suppress stale invalidated update check results and errors across offline transitions, and updatedocs/architecture/cloud-integrations.mdandtests/offline-mode.test.ts.Risk Assessment
✅ Low: The changes cleanly and durably close the Offline mode gaps across backup restore/import, PostHog flush suppression, in-flight request cancellation, telemetry timer resumption, cloud auto-registration retries, and updater check invalidation with comprehensive behavioral tests.
Testing
Ran the focused offline-mode, update-state, telemetry, tax-pack-catalog, and product-images test suites and drove all six Offline mode scenarios live against a disposable Express API, SQLite database, and local HTTP/TCP servers, recording structured evidence to
~/.no-mistakes/evidence/01M5JTP8ZYKKVH14K90HVKXJ8K/offline-mode-live-validation.json(no screenshot artifact was captured because this change touches only backend services, API routes, and documentation with no UI surface changes); all scenarios and suites passed.npm run test:offline-modenpm run test:offline-modenpm run test:offline-modenpm run test:offline-modenpm run test:offline-modenpm run test:offline-modeEvidence: Live Offline-Mode Validation Evidence JSON
Evidence: Offline Mode Integration Suite Output
Source: Offline Mode Integration Suite Output
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
✅ No issues found.
✅ **Test** - passed
✅ No issues found.
npm run test:offline-modenpm run test:update-statenpm run test:telemetrynpm run test:tax-pack-catalognpm run test:tax-pack-managementnpm run test:shutdown-lifecyclenode -e "<live validation harness against compiled dist/main server, SQLite DB, and local HTTP/TCP endpoints>"✅ No issues found.
npm run test:offline-modenpm run test:offline-modenpm run test:offline-modenpm run test:offline-modenpm run test:offline-modenpm run test:offline-modenpm run test:offline-modenpm run test:update-statenpm run test:telemetrynpm run test:tax-pack-catalognpm run test:product-imagesLive disposable Express/SQLite/HTTP/TCP validation script writing~/.no-mistakes/evidence/01M5JTP8ZYKKVH14K90HVKXJ8K/offline-mode-live-validation.json✅ **Document** - passed
✅ No issues found.
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ No issues found.
✅ **Push** - passed
✅ No issues found.
✅ No issues found.