Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: excluded_inputs_regex argument is not respected #192

Open
1 task done
Gotfrid opened this issue Oct 16, 2024 · 0 comments · May be fixed by #196
Open
1 task done

[Bug]: excluded_inputs_regex argument is not respected #192

Gotfrid opened this issue Oct 16, 2024 · 0 comments · May be fixed by #196
Labels

Comments

@Gotfrid
Copy link
Member

Gotfrid commented Oct 16, 2024

Guidelines

  • I agree to follow this project's Contributing Guidelines.

Project Version

0.3.1

Platform and OS Version

uname -a:

Darwin Pavels-MBP.Home 24.0.0 Darwin Kernel Version 24.0.0: Tue Sep 24 23:36:26 PDT 2024; root:xnu-11215.1.12~1/RELEASE_ARM64_T8103 arm64

Existing Issues

No response

What happened?

I have a bunch of events auto-generated by DT which are all in a single module. I would like to ignore them, when I noticed that usage of excluded_inputs_regex has no effect.

I looked into the code, and it seems to me that the reason is in string escaping here.

Steps to reproduce

  1. create a simple app with a datatable and log file data storage
  2. start telemetry session with track_inputs = FALSE
  3. explicitly log all events with exclude regex
  4. check the log file to find all the excluded events still being tracked

Expected behavior

Should not see excluded events.

Attachments

library(DT)
library(shiny)
library(shiny.telemetry)

data_storage <- DataStorageLogFile$new("telemetry.log")
telemetry <- Telemetry$new(data_storage = data_storage)

shinyApp(
  ui = fluidPage(
    use_telemetry(),
    DTOutput("table")
  ),
  server = function(input, output) {
    telemetry$start_session(track_inputs = FALSE)
    telemetry$log_all_inputs(excluded_inputs_regex = "^table*")
    output$table <- renderDT({
      data <- datasets::mtcars
      datatable(data)
    })
  }
)

Screenshots or Videos

No response

Additional Information

telemetry.log contents:

{"app_name":["(dashboard)"],"type":["login"],"session":["b74b4769a934623dd7a77bc1b8867c42"],"details":["{\"username\":[\"anon_user_ced824bf8643095d9043773ce4e58b4ef0e42aec1f270dd34cac1e8ed40cbd20\"]}"],"time":[1729240079.7158]}
{"app_name":["(dashboard)"],"type":["browser"],"session":["b74b4769a934623dd7a77bc1b8867c42"],"details":["{\"value\":[\"Chrome 130\"]}"],"time":[1729240079.7373]}
{"app_name":["(dashboard)"],"type":["input"],"session":["b74b4769a934623dd7a77bc1b8867c42"],"details":["{\"id\":[\"table_rows_selected\"],\"value\":{}}"],"time":[1729240079.7461]}
{"app_name":["(dashboard)"],"type":["input"],"session":["b74b4769a934623dd7a77bc1b8867c42"],"details":["{\"id\":[\"table_columns_selected\"],\"value\":{}}"],"time":[1729240079.7474]}
{"app_name":["(dashboard)"],"type":["input"],"session":["b74b4769a934623dd7a77bc1b8867c42"],"details":["{\"id\":[\"table_cells_selected\"],\"value\":{}}"],"time":[1729240079.7483]}
{"app_name":["(dashboard)"],"type":["input"],"session":["b74b4769a934623dd7a77bc1b8867c42"],"details":["{\"id\":[\"table_rows_current\"],\"value\":{}}"],"time":[1729240079.749]}
{"app_name":["(dashboard)"],"type":["input"],"session":["b74b4769a934623dd7a77bc1b8867c42"],"details":["{\"id\":[\"table_rows_all\"],\"value\":{}}"],"time":[1729240079.7498]}
{"app_name":["(dashboard)"],"type":["input"],"session":["b74b4769a934623dd7a77bc1b8867c42"],"details":["{\"id\":[\"table_state\"],\"value\":{}}"],"time":[1729240079.7504]}
{"app_name":["(dashboard)"],"type":["input"],"session":["b74b4769a934623dd7a77bc1b8867c42"],"details":["{\"id\":[\"table_search\"],\"value\":{}}"],"time":[1729240079.7513]}
{"app_name":["(dashboard)"],"type":["input"],"session":["b74b4769a934623dd7a77bc1b8867c42"],"details":["{\"id\":[\"table_cell_clicked\"],\"value\":{}}"],"time":[1729240079.7522]}
{"app_name":["(dashboard)"],"type":["input"],"session":["b74b4769a934623dd7a77bc1b8867c42"],"details":["{\"id\":[\"table_rows_current\"],\"value\":{}}"],"time":[1729240079.7627]}
{"app_name":["(dashboard)"],"type":["input"],"session":["b74b4769a934623dd7a77bc1b8867c42"],"details":["{\"id\":[\"table_rows_all\"],\"value\":{}}"],"time":[1729240079.7637]}
{"app_name":["(dashboard)"],"type":["input"],"session":["b74b4769a934623dd7a77bc1b8867c42"],"details":["{\"id\":[\"table_state\"],\"value\":{}}"],"time":[1729240079.7677]}
{"app_name":["(dashboard)"],"type":["logout"],"session":["b74b4769a934623dd7a77bc1b8867c42"],"details":["{\"username\":[\"anon_user_ced824bf8643095d9043773ce4e58b4ef0e42aec1f270dd34cac1e8ed40cbd20\"]}"],"time":[1729240085.7929]}
@Gotfrid Gotfrid added the bug label Oct 16, 2024
@Gotfrid Gotfrid linked a pull request Dec 13, 2024 that will close this issue
4 tasks
@Gotfrid Gotfrid linked a pull request Dec 13, 2024 that will close this issue
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant