Skip to content

Unecessary MainLog update #24

@raphidoc

Description

@raphidoc

Describe the bug
When changing a project (i.e. a project is already open, and we open another one), OldMainLog is not updated (to the newly selected project) before

sear/R/mod_parse_data.R

Lines 102 to 130 in a0fbf7a

UpdateMainLog <- observeEvent(
{
MTELog$ParsedData()
},
{
# Create a Progress object
progress <- shiny::Progress$new()
progress$set(message = "MainLog check", value = 0)
# Close the progress when this reactive exits (even if there's an error)
on.exit(progress$close())
OldMainLog <- MainLog()
PrimMainLog <- MTELog$Apla() %>%
rename(Lon = Lon_DD, Lat = Lat_DD)
# TODO Need to figure out how to compute on BioSonic Load
# | !is.null(BioSonic$BioSonic())
if (nrow(OldMainLog) == nrow(PrimMainLog)) {
message("MainLog up to date")
progress$set(value = 1, detail = " up to date")
} else {
message("Updating MainLog")
is computed.
This lead to a useless recomputation of MainLog.

To Reproduce
Steps to reproduce the behavior:

  1. Select a project with data already parsed (MainLog should be already computed)
  2. Select another project with different data already parsed
  3. MainLog() is updated because the Old (actually from the old project) and the New (newly selected project) don't have the same number of lines

Expected behaviour
MainLog to be the one of the newly selected project before UpdateMainLog be computed

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinginvalidThis doesn't seem right

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions