Skip to content

Fetching file contents from JavaScript does not return correct content #897

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

Closed
yanickrochon opened this issue Mar 15, 2019 · 9 comments
Closed

Comments

@yanickrochon
Copy link

Nature of issue?

  • Found a bug

  • Steps to reproduce this bug:

  1. Create a new project,
  2. Add a new file (ex: async-file.js)
  3. Edit that file with anything
  4. Go to the file URL (using another tab), for example : https://editor.p5js.org/<user_name>/sketches/<sketch_id>/async-file.js
  5. Go back to the editor and modify async-file.js
  6. Save the whole project
  7. Go back to the other tab displaying the content of async-file.js and refresh (F5)
  8. The content has not changed.

This issue still occurs if all browser cache is disabled, or cleared, etc. The file content does not reflect the content in the editor.

@catarak
Copy link
Member

catarak commented Mar 15, 2019

thanks for reporting! i am seeing this issue. i wonder what's going on here...

@yanickrochon
Copy link
Author

I added an URL GET parameter, and it seems to fix the problem. It is perhaps server caching?

@catarak
Copy link
Member

catarak commented Mar 15, 2019

i think it must be a serving caching issue.

@yanickrochon
Copy link
Author

As far as I can tell, it seems like the files are stored on AWS, and directly accessing a project file through GET URLs make an internal redirect to AWS. Is it possible that the content of the file is not correctly updated on the remote server? Or perhaps AWS performs caching on it's own there.

See project.controller.js

@catarak
Copy link
Member

catarak commented Mar 15, 2019

small, plaintext files are not stored on AWS but are instead stored in mongodb

@siddhant1
Copy link
Contributor

I will take this @catarak , will try to investigate and fix

@GaurangTandon
Copy link
Contributor

@siddhant1 If you're not working on this issue, may I take it up?

@siddhant1
Copy link
Contributor

Still working on this :)

@catarak
Copy link
Member

catarak commented Feb 10, 2021

Fixed by #1234.

@catarak catarak closed this as completed Feb 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants