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

gatsby develop not reflecting changes in textbundle files when written via mac application #36877

Closed
2 tasks done
markphilpot opened this issue Oct 25, 2022 · 1 comment · May be fixed by #36975
Closed
2 tasks done
Labels
type: bug An issue or pull request relating to a bug in Gatsby

Comments

@markphilpot
Copy link

Preliminary Checks

Description

My workflow uses Ulysses and it's External Folder and TextBundle support (http://textbundle.org). The layout for a post looks something like:

my_post.textbundle/
  info.json
  text.md
  assets/
    my_image.jpg

When Ulysses "saves" the textbundle, it effectively removes the my_post.textbundle "directory" and rewrites the entire contents (the contents of text.md are updated, but the containing textbundle directory was swapped at the same time)

When running gatsby develop and I make a change in Ulysses, gatsby sees the directory changing. I see this in the console:

info added directory at /Users/mphilpot/projects/gatsby_blog/content/blog/2022/my_post.textbundle

However, the browser never reflects the updated content in text.md (as written by Ulysses). Refreshing the page or navigating away has no effect: the content will only show the original state of text.md when gatsby develop started.

Reproduction Link

https://github.com/markphilpot/gatsby_example_blog

Steps to Reproduce

You can't reproduce this via the command line unfortunately. If you look at the TextBundle spec, there are some Mac utlities here -- https://github.com/shinyfrog/TextBundle

The mac code uses NSFileWrapper in directory mode, to essentially flush the filewrapper to disk.

https://developer.apple.com/documentation/foundation/nsfilewrapper/1415981-writetourl

CleanShot 2022-10-24 at 21 03 43@2x

This method uses some filesystem hard linking in it's write process.

Gatsby's filesystem monitoring only sees a new directory and not the changed content.

Expected Result

When viewing post in the browser, the content would reflect the new changes as textbundle files are saved.

Actual Result

The my_post page has the original text.md content, even if you refresh or navigate away and back again.

Environment

System:
    OS: macOS 12.6
    CPU: (10) arm64 Apple M1 Max
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 16.17.1 - /var/folders/5t/js69fd692gxc46mpb_q6l9y00000gn/T/yarn--1666668329495-0.855140295326833/node
    Yarn: 1.22.19 - /var/folders/5t/js69fd692gxc46mpb_q6l9y00000gn/T/yarn--1666668329495-0.855140295326833/yarn
    npm: 8.15.0 - /opt/homebrew/bin/npm
  Browsers:
    Chrome: 106.0.5249.119
    Firefox: 106.0.1
    Safari: 16.0
  npmPackages:
    gatsby: ^4.2.0 => 4.24.4 
    gatsby-awesome-pagination: ^0.3.8 => 0.3.8 
    gatsby-image: ^3.11.0 => 3.11.0 
    gatsby-plugin-feed-generator: ^2.0.5 => 2.0.5 
    gatsby-plugin-image: ^2.2.0 => 2.24.0 
    gatsby-plugin-manifest: ^4.2.0 => 4.24.0 
    gatsby-plugin-mdx: ^3.2.0 => 3.20.0 
    gatsby-plugin-offline: ^5.2.0 => 5.24.0 
    gatsby-plugin-postcss: ^5.22.0 => 5.24.0 
    gatsby-plugin-react-helmet: ^5.2.0 => 5.24.0 
    gatsby-plugin-sharp: ^4.2.0 => 4.24.0 
    gatsby-plugin-typography: ^4.2.0 => 4.24.0 
    gatsby-remark-copy-linked-files: ^5.2.0 => 5.24.0 
    gatsby-remark-images-custom: file:./plugins/gatsby-remark-images-custom => 6.3.0-next.0 
    gatsby-remark-prismjs: ^6.2.0 => 6.24.0 
    gatsby-remark-responsive-iframe: ^5.2.0 => 5.24.0 
    gatsby-remark-smartypants: ^5.2.0 => 5.24.0 
    gatsby-source-filesystem: ^4.2.0 => 4.24.0 
    gatsby-source-graphql: ^4.1.0 => 4.24.0 
    gatsby-transformer-remark: ^5.2.0 => 5.24.0 
    gatsby-transformer-sharp: ^4.2.0 => 4.24.0

Config Flags

No response

@markphilpot markphilpot added the type: bug An issue or pull request relating to a bug in Gatsby label Oct 25, 2022
@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Oct 25, 2022
@LekoArts LekoArts removed the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Oct 25, 2022
@LekoArts
Copy link
Contributor

Hi, thanks for the issue.

Unfortunately I have to mark this as a "won't fix" for now. The impact/reach is too low and the effort for this to get it working is quite big.

When the server is started gatsby-source-filesystem is adding each file into the Node store and tracks it from there on. So when a file is changed we can update the internal database. However, files need to stay around for this to work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug An issue or pull request relating to a bug in Gatsby
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants