Skip to content

Gate SW/FW update checking on CHECK_FOR_UPDATES independent of BUILD_WITH_LIBCURL - #15682

Merged
Nir-Az merged 3 commits into
realsenseai:developmentfrom
Binyaminp:fix-check-for-updates-flag
Sep 15, 2026
Merged

Nir-Az merged 3 commits into
realsenseai:developmentfrom
Binyaminp:fix-check-for-updates-flag

Conversation

@Binyaminp

@Binyaminp Binyaminp commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

Overview: Restores CHECK_FOR_UPDATES as the sole switch for the SW/FW update-check feature, so setting it OFF actually disables update checking again.

Tracked on [RSDSO-21555]

Why

PR #15249 (RUM Phase 1) refactored the shared HTTP layer used by both the SW/FW update-checker and the new RUM stats uploader. The old common/sw-update/http-downloader.cpp had its own #ifdef CHECK_FOR_UPDATES guard that made it a no-op when the flag was off. The replacement common/http/http-downloader.cpp has no such guard — it always forwards to curl_wrapper, which only becomes a no-op when BUILD_WITH_LIBCURL is undefined. Since BUILD_WITH_LIBCURL is defined whenever CHECK_FOR_UPDATES OR ENABLE_STATS is on, and ENABLE_STATS defaults to ON, the update-checker kept making real network calls even with -DCHECK_FOR_UPDATES=OFF.

Summary

  • device_model::check_for_device_updates() now returns immediately when CHECK_FOR_UPDATES isn't defined, before any network work. The "Check For Updates" context-menu item is left as-is (unreachable network call becomes a no-op, matching its pre-existing behavior when the flag is off).

Test plan

  • Rebuilt realsense-viewer (Release, CHECK_FOR_UPDATES=ON, ENABLE_STATS=ON) — compiles and links cleanly, existing behavior unchanged.
  • Manually tested ENABLE_STATS=ON / CHECK_FOR_UPDATES=OFF — update checking correctly disabled.
  • Manually tested ENABLE_STATS=ON / CHECK_FOR_UPDATES=ON — update checking works as expected.

🤖 Generated with Claude Code

…WITH_LIBCURL

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

@sysrsbuild-gh-agentic sysrsbuild-gh-agentic left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Auto-generated review by rs-agentic bot

The fix correctly restores CHECK_FOR_UPDATES as the sole gate for update-check network traffic. Two minor points inline.

Comment thread common/device-model.cpp
#ifndef CHECK_FOR_UPDATES
// BUILD_WITH_LIBCURL (and therefore the http_downloader this relies on) may still be on
// because of ENABLE_STATS; this flag stays the sole on/off switch for update checking.
return;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

[rs-agentic bot] ⚠️ Potential BUG / UX issue: When activated_by_user == true (user manually triggered the check via UI), this silent return gives no feedback. The caller may be expecting a result or UI update. Consider logging a debug message (e.g. LOG_DEBUG("Update check skipped: CHECK_FOR_UPDATES is OFF")) so it's diagnosable, and verify the call site handles a no-op gracefully without leaving the UI in a stale state.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

change approved

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

✅ Fixed in 69c87b2. Moved the guard to the call sites instead: both the automatic check in refresh_notifications() and the manual "Check For Updates" menu item are now wrapped in #ifdef CHECK_FOR_UPDATES. The menu item no longer exists when the flag is off, so there's nothing left to trigger the no-op.

🤖 Generated by AI

Comment thread common/device-model.cpp Resolved
Comment thread common/device-model.cpp Resolved
Binyaminp and others added 2 commits September 15, 2026 16:43
…he function

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
… early return

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@Nir-Az
Nir-Az merged commit 3105cb1 into realsenseai:development Sep 15, 2026
34 of 35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants