Skip to content

Pub Serve not noticing file changes from editors in 'safe write' mode (e.g., IntelliJ) on OSX #21402

Closed

Description

@pq

Pub serve does not appear to play nice with editors (specifically IntelliJ/IDEA) on OS X that use a 'safe write' mode (e.g., new file content is first saved to a temporary file, then the original file is deleted after which the temporary file is renamed to the original file name).

We were able to reproduce with InitelliJ on OSX using the Finance_Dart sample like so:

  * Open Finance_Dart/client/web/app.html in browser (Chrome or Dartium or ...). Wait for page load.
  * Modify Finance_Dart.client/web/app/view/item_list/day_purchases_list.html. For example, change

       border-bottom: 1px dashed;
    
     to:

       border-bottom: 1px dashed red;

  * Refresh browser and you won't see dashed line color change. :( Only restarting pub serve will do it.

NOTE: this issue does NOT affect Dart Editor as it triggers explicit reloads itself on text editor pane content changes.

It would be super awesome if we could get this looked at for 1.8. :)

Activity

  1. pq commented on Oct 24, 2014

    @pq
    MemberAuthor

    More background in this Jetbrains ticket: https://youtrack.jetbrains.com/issue/WEB-13739

  2. DartBot commented on Oct 24, 2014

    @DartBot

    This comment was originally written by alexander.dor...@gmail.com


    The issue is very important for JetBrains IDE users because 'safe write' mode is enabled by default in all IDEs: WebStorm, IntelliJ IDEA, PhpStorm, RubyMine, PyCharm. Android Studio is affected as well, 'safe write' is also enabled by default there. Users who see Pub Serve not picking changes get no idea how to solve the issue without Pub Serve restart.

  3. sethladd commented on Jan 15, 2015

    @sethladd
    Contributor

    Hi, Friendly ping... @­Bob, were you planning to take a look at this? Or was @­Natalie going to take a peak at the underlying issue?

    Thanks so much for investigating!


    cc @nex3.
    Removed Priority-Unassigned label.
    Added Priority-High label.

  4. nex3 commented on Jan 15, 2015

    @nex3
    Member

    This wasn't triaged properly, so I don't think we ever saw it :p. In order for a pub bug to pop up on our radar, it really needs to have the "Area-Pub" label.


    Added Area-Pub label.

  5. alan-knight commented on Jan 15, 2015

    @alan-knight
    Contributor

    A command-line reproduction.

    • Take any pub package that serves a web page. e.g. git clone https://github.com/dart-lang/sample-todomvc-polymer.git
    • pub serve
    • find some known string in the output, e.g. curl localhost:8080 | grep Mark, which for todomvc shows a single line with a label "Mark all as completed".
    • copy the file that contains this string to something else, e.g. cp lib/td_todos.html lib/td_todos2.html
    • edit the copied version and change the string
    • mv lib/td_todos2.html lib/td_todos.html
    • check the output again, notice that it hasn't changed.
    • kill pub serve, restart it
    • check the output, now it's changed.
  6. munificent commented on Jan 22, 2015

    @munificent
    Member

    Added Started label.

  7. munificent commented on Jan 26, 2015

    @munificent
    Member

    This should be working now. The underlying issue was in the watcher package, fixed here:

    https://codereview.chromium.org/861313006/

    Then pulled into the repo for pub and tested here:

    https://codereview.chromium.org/801943005/
    https://codereview.chromium.org/870703003/


    Added Fixed label.

  8. DartBot commented on Jan 26, 2015

    @DartBot

    This comment was originally written by @sethladd


    Thanks!

  9. DartBot commented on Jan 27, 2015

    @DartBot

    This comment was originally written by alexander.dor...@gmail.com


    Verified in today's nightly build. Thanks a lot!

  10. munificent commented on Jan 27, 2015

    @munificent
    Member

    \o/

  11. pq commented on Jan 27, 2015

    @pq
    MemberAuthor

    Fantastic. Thanks everybody!

  12. added
    P1A high priority bug; for example, a single project is unusable or has many test failures
    on Jan 27, 2015
  13. DartBot commented on Jun 5, 2015

    @DartBot

    This issue has been moved to dart-lang/pub#1177.

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

Metadata

Metadata

Assignees

Labels

P1A high priority bug; for example, a single project is unusable or has many test failures

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions