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

command curl -X POST http://localhost:8000/__refresh doesn't delete the documents from the CMS #38912

Open
2 tasks done
MathieuWEILAN opened this issue Mar 26, 2024 · 0 comments
Labels
status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer type: bug An issue or pull request relating to a bug in Gatsby

Comments

@MathieuWEILAN
Copy link

Preliminary Checks

Description

I'm using the Gatsby Livepreview on my Gatsby App (version 5.12.4).
So I have this variable in my env.development file : ENABLE_GATSBY_REFRESH_ENDPOINT=true
My Gatsby app is connected to a CMS Drupal (version 10).
When i used to change or add a new document in my CMS, and then launch the command "curl -X POST http://localhost:8000/__refresh", i can see the modifications in realtime.
But when i delete a document from my CMS, and then refresh my page, the document is still displayed.
I put some logs in the gatsby-node.js, and i can see that when the _refresh is done, the document is no more fetch. But it will be displayed on the front.
The only way is to rebuild my app with "gatsby develop" to make it disappears.

I can't find any solutions to apply the same behavior for ADD / MODIFY and DELETE.

Is it a normal behavior ? How can i have the same behavior when i delete a document.

Reproduction Link

https://codesandbox.io/p/devbox/awesome-gates-vksw35?file=%2Fsrc%2Fplugins%2Fgatsby-source-documents%2Fgatsby-node.js%3A26%2C21

Steps to Reproduce

  1. Launch the app with "gatsby develop"
  2. Go to your CMS, and delete a document
  3. Launch the refresh with the command in a new terminal : curl -X POST http://localhost:8000/__refresh
  4. Check the front if the document is still displayed
    ...

Expected Result

I want to have the same behavior than Add and Modify documents.
When the server is running, when i delete my document in my CMS, and the launch the command "curl -X POST http://localhost:8000/__refresh ", the document shouldn't appear in my front.

Actual Result

The document is still displayed in my front. The only way to make it disappear, is to relaunch my app with a "gatsby develop".

Environment

Node : v20.11.0
yarn : 1.22.21
gatsby : 5.12.4
Drupal : 10
macOs : 14.3.1

Config Flags

No config Flag

@MathieuWEILAN MathieuWEILAN added the type: bug An issue or pull request relating to a bug in Gatsby label Mar 26, 2024
@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Mar 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer type: bug An issue or pull request relating to a bug in Gatsby
Projects
None yet
Development

No branches or pull requests

1 participant