Skip to content

Using browser() in new file causes double tab of the same file #12702

Open

Description

@CGMossa

System details

RStudio Edition : Desktop
RStudio Version :  2022.12.0+353
OS Version      :  Windows 10, Version 20H2
R Version       : R version 4.2.2 (2022-10-31 ucrt)

Steps to reproduce the problem

  1. Create new file
  2. Write browser() in it.
  3. Save file
  4. Run it;
  5. Now, there are two tabs open with the same file.

Describe the problem in detail

This causes you to have two tabs open, one in the initial state, and one further. If you
accidentally save in one of the tabs, it overwrites the file on disk.
Absolutely no warning is given

Describe the behavior you expected

I don't expect this to happen:
image

This has caused me to lose several hours of work, twice in one day.

  • I have read the guide for submitting good bug reports.
  • I have installed the latest version of RStudio, and confirmed that the issue still persists.
  • If I am reporting an RStudio crash, I have included a diagnostics report.
  • I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.

Activity

  1. added
    new
    on Feb 13, 2023
  2. ronblum commented on Feb 16, 2023

    @ronblum
    Contributor

    @CGMossa Thank you for raising the issue! I'm unable to reproduce it, though. How are you running the script in step 4—sourcing the file, running the individual command, etc.?

    Here's what I get on Windows:
    browser

  3. added
    info needed
    and removed
    new
    on Feb 16, 2023
  4. CGMossa commented on Feb 17, 2023

    @CGMossa
    Author

    I think I'm sourcing the file.

    This issue happens on both of my machines.
    I install rstudio through scoop.

  5. mikebessuille commented on Feb 21, 2023

    @mikebessuille
    Contributor

    @CGMossa does this happen if you are not using symlink files?

  6. CGMossa commented on Feb 21, 2023

    @CGMossa
    Author

    I don't know what you mean by symlink file.
    I'm not sure I'm doing that. The issue I was referencing was doing that, but I'm not.

  7. mikebessuille commented on Feb 21, 2023

    @mikebessuille
    Contributor

    Ah thanks for that clarification! We have not been able to reproduce this internally yet, so I assumed it was related to symlink files. If you are able to open the same file in two separate windows and edit them separately, I see that as a fairly urgent problem to solve because it can lead to data loss as you experienced.

    Would you be willing to try the latest daily (https://dailies.rstudio.com/) to see if this happens with the latest release on your environment? Trying to narrow down the circumstances in which this can occur, since we haven't seen it internally yet despite several people trying. We'd really like to solve this.

  8. CGMossa commented on Feb 21, 2023

    @CGMossa
    Author
  9. CGMossa commented on Feb 21, 2023

    @CGMossa
    Author

    I can report that using daily build ‘2023.3.0.330’, the issue is still present.

  10. mikebessuille commented on Feb 21, 2023

    @mikebessuille
    Contributor

    Thanks! @ronblum I think someone should see if installing using scoop is somehow related to this.

  11. ronblum commented on Feb 21, 2023

    @ronblum
    Contributor

    I installed with scoop using
    scoop bucket add extras
    and
    scoop install
    which installed RStudio Desktop 2022.12.0+353. I'm not able to reproduce the issue. If I source the file, the debugger lands on the browser() line in the source file. If I execute the code line by line, a new tab opens up which only contains the function definition, not a duplicate file.

  12. CGMossa commented on Feb 21, 2023

    @CGMossa
    Author

    Remember. It only happens the first time a fresh new file is made.
    Make new file. Save it. Browser call. Bang new tab.
    Close old tab. Keep going. Everything works then.
    You have to create a new file.

  13. added this to the Backlog-2 milestone on Apr 24, 2023
  14. added and removed
    info needed
    on Apr 24, 2023
  15. modified the milestones: Backlog-2, Later on Oct 5, 2023
  16. removed their assignment
    on Sep 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions