unfoldingWord / tc-create-app

translationCore Create
https://create.translationcore.com/
MIT License
0 stars 5 forks source link

Local edits lost if the file on the server is changed #1549

Open elsylambert opened 1 year ago

elsylambert commented 1 year ago

Steps:

Notes from Rich: Under the hood, in the network response, I can see:

{"message":"sha does not match [given: dfb6a4bd57849cf8b06979bf35316cafd4d1a8af, expected: 90dd1e6d363343a06e5183350f36fe1a44a53340]","url":"https://git.door43.org/api/swagger%22%7D

I worked with a content editor previously where I was the one who changed the file on the server. Yet then they kept logging in again, with their changes still there, but still wouldn't save. Apparently tCC still wasn't getting the new SHA. I'll ask him what is happening this time, but does it really let you clobber once you log in again? Before it wasn't. The previous time, when I had made a commit, I had to undo my commit, then it worked. Maybe I can undo his last save if his system is still using the previous save's file SHA. Will try that. But doesn't seem to be updating the SHA in tCC. I think this error message used to give us the two SHAs that don't compare, but was too technical so now doesn't show it. Wonder if still a way for them to easily get it without doing all the dev stuff in their browser.

elsylambert commented 1 year ago

@birchamp Instead of the login dialog box, there should be the modal warning that the "Save action would clobber the file on the server, do you want to keep or discard the server changes?" like how we had it when autosave feature was enabled.

JRA-zachpennington commented 1 year ago

Hi @birchamp , bincy, @elsylambert !! πŸ‘‹πŸ‘‹ πŸ˜ƒ

LONG TIME NO SEE! :) Is this bug report still open? May I look at it as an outside contributor?

JRA-zachpennington commented 1 year ago

I have identified the chain of how the exception propagates & is handled...
But there are a few possible ways to handle the file conflict & would be good to discuss :) Plus would love to catch up!! :)

JRA-zachpennington commented 1 year ago

tcc saveTranslation()

saveFile():

updateContent()

Suggestion:

.