Skip to content

RDKEMW-13750: Remove Telemetry Optout fallback logic#52

Open
gomathishankar37 wants to merge 3 commits intodevelopfrom
topic/RDKEMW-13750
Open

RDKEMW-13750: Remove Telemetry Optout fallback logic#52
gomathishankar37 wants to merge 3 commits intodevelopfrom
topic/RDKEMW-13750

Conversation

@gomathishankar37
Copy link
Copy Markdown
Contributor

No description provided.

@gomathishankar37 gomathishankar37 requested a review from a team as a code owner March 23, 2026 05:11
Copilot AI review requested due to automatic review settings March 23, 2026 05:11
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Removes Telemetry Opt-Out fallback logic across the crashupload implementation (C code + legacy shell wrapper) and updates unit tests/docs to align with the new behavior.

Changes:

  • Removed TelemetryOptOut config plumbing (get_opt_out_status(), opt_out field, RFC constant) and corresponding runtime branching.
  • Removed shell-script gating that skipped uploads for mediaclient when TelemetryOptOut was set.
  • Updated/trimmed unit tests and unittest documentation to reflect removal of opt-out behavior.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
unittest/prerequisites_gtest.cpp Removes opt_out setup in tests (but leaves opt-out assertions that now need updating).
unittest/config_manager_gtest.cpp Deletes get_opt_out_status() tests and removes opt_out expectation from integration test.
unittest/TEST_SUMMARY.md Removes opt-out items from summary table/targets (but still contains opt-out sections that need cleanup).
unittest/README.md Updates documented functions covered by unit tests to drop opt-out.
runDumpUpload.sh Removes TelemetryOptOut gating function and mediaclient opt-out skip block.
c_sourcecode/src/utils/prerequisites.c Removes TelemetryOptOut early-exit/cleanup branch from prerequisites.
c_sourcecode/src/utils/cleanup_batch.c Updates removal log message to no longer mention TelemetryOptOut.
c_sourcecode/src/rfcInterface/rfcinterface.h Removes TelemetryOptOut RFC define.
c_sourcecode/src/main.c Updates flow comment to reflect revised privacy/deferred-upload step.
c_sourcecode/src/config/config_manager.h Removes get_opt_out_status() declaration.
c_sourcecode/src/config/config_manager.c Removes get_opt_out_status() implementation and config->opt_out initialization.
c_sourcecode/common/types.h Removes opt_out from config_t.
Comments suppressed due to low confidence (4)

runDumpUpload.sh:625

  • After removing the TelemetryOptOut gate, the script still contains log text that says dumps are removed because "TelemetryOptOut is set" (in removePendingDumps()). That message is now misleading; please update it (and any similar strings) to reflect the remaining reasons dumps can be removed.
# Upon exit, remove locking
trap finalize EXIT

if [ ! -f /tmp/coredump_mutex_release ] && [ "$DUMP_FLAG" == "1" ]; then
     logMessage "Waiting for Coredump Completion"
     sleep 21
fi

unittest/prerequisites_gtest.cpp:295

  • These tests still assert the old TelemetryOptOut behavior (return code 1 after cleanup), but the opt-out logic was removed from prerequisites_wait(). With a dump present, prerequisites_wait() should now return PREREQUISITES_SUCCESS (or the test should be removed/repurposed). Update the expected return value and test intent accordingly.
TEST_F(PrerequisitesTest, PrerequisitesWait_MediaClient_OptOut_CleansUp) {
    test_config.device_type = DEVICE_TYPE_MEDIACLIENT;
    test_config.dump_type = DUMP_TYPE_MINIDUMP;
    CreateDumpFile(test_minidump_dir, "crash.dmp");
    
    int ret = prerequisites_wait(&test_config, 30);
    
    // Should return 1 (cleanup done)
    EXPECT_EQ(ret, 1);
}

unittest/prerequisites_gtest.cpp:305

  • Same issue as the minidump variant: this test still expects the removed TelemetryOptOut branch to return 1. After removing opt-out handling, a matching coredump should result in PREREQUISITES_SUCCESS (or the test should be deleted/repurposed).
TEST_F(PrerequisitesTest, PrerequisitesWait_MediaClient_OptOutCoredump_CleansUp) {
    test_config.device_type = DEVICE_TYPE_MEDIACLIENT;
    test_config.dump_type = DUMP_TYPE_COREDUMP;
    CreateDumpFile(test_core_dir, "app_core.12345");
    
    int ret = prerequisites_wait(&test_config, 30);
    
    EXPECT_EQ(ret, 1);
}

unittest/TEST_SUMMARY.md:85

  • This "File Status Tests" section is describing the removed get_opt_out_status() behavior (RFC + file contents). Since TelemetryOptOut fallback logic was removed, these bullets should be removed or rewritten to document the current privacy/permission checks that remain.
#### File Status Tests
- ✅ Both RFC and file are "true" → returns true
- ✅ File doesn't exist → returns false
- ✅ File contains "false" → returns false
- ✅ File is empty → returns false

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings April 1, 2026 12:38
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 18 out of 18 changed files in this pull request and generated 5 comments.

Comments suppressed due to low confidence (2)

unittest/TEST_SUMMARY.md:86

  • The "File Status Tests" bullets describe RFC/file-based telemetry opt-out behaviors ("Both RFC and file are true", "/tmp" file missing, etc.), but those tests/logic were removed along with get_opt_out_status(). This section should be removed or rewritten to document the current privacy-mode behavior and its test coverage.
#### File Status Tests
- ✅ Both RFC and file are "true" → returns true
- ✅ File doesn't exist → returns false
- ✅ File contains "false" → returns false
- ✅ File is empty → returns false

c_sourcecode/src/main.c:72

  • The 7-step flow comment is out of sync with the actual main() implementation below: the code acquires the lock before running prerequisites_wait() and before calling get_privacy_control_mode(), but the comment lists prerequisites/privacy checks before lock acquisition. Update the step ordering (and/or wording about "deferred upload") to match the code path so readers aren't misled.
 * Implements optimized 7-step flow:
 * 1. Consolidated initialization (parse + config + platform)
 * 2. Combined prerequisites check (network + time)
 * 3. Privacy check and deferred upload if needed
 * 4. Lock acquisition
 * 5. Process dumps (scan, archive, upload, rate limit)
 * 6. Batch cleanup
 * 7. Shutdown

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants