File written to by the program not saving occasionally
h
Baconman321 (1104)

I have a program in Go that allows me to make and edit articles.

Sometimes, though the program won't save an edit of the article. The articles are stored via a .json file.

I have noticed that this usually happens if I close out of the window after it says it has successfully been edited, OR I close out of the computer. It always saves if I open the repl and check if it has been saved (as far as I know).

@tussiez told me that it was simply replit not saving sometimes, but I start to doubt that. It shows the edited article, but if I come back the next day the new edit is gone! It must be deleting the contents of the edit, but why? Also, how would I fix this?

Help would be appreciated.

- A confused bacon

You are viewing a single comment. View All
Andy_4sberg (54)

@Baconman321 try running the program in the same tab as it's code on replit. Does it work? If it does, I think it works because it's running as the owner, and gives itself permission write. Does it work on the site in a new tab? If it does, I'm very confused. If it doesn't, I think the new tab is a new instance of the program, and the instance of it is greater on replit, so it overwrites the data (the one running in replit). This is just a theory, so of course I don't know if it's correct.