dynamicdan / sn-filesync

2-way sync ServiceNow field values to local files
MIT License
66 stars 37 forks source link

issue saving, not uploading local changes to instance #33

Closed jacebenson closed 8 years ago

jacebenson commented 8 years ago

Trying to set this up. I wanted to include inbound actions, and I have them downloading but when I try to edit a file, once I save, it resyncs the instance version over my update.

dynamicdan commented 8 years ago

What command do you use to start FileSync? What is your project/directory setup looking like? Have you tried using a different editor (eg. one without "atomic saves")?

What folder config did you add for this inbound action? By default I don't think there is any configuration for it in lib/records.config.json.

jacebenson commented 8 years ago

Command I use to start; node bin/app.js --config app.config.json I added the following to the app.config.json in the folders object; "inbound_actions": { "table": "sysevent_in_email_action", "key": "name", "fields":{ "js": "script" }, "subDirPattern": "table" },

I did just now try a different editor and it works. I guess Visual Studio Code must do this atomic saves. I'll have to look to see if there's a way to turn it off or go back to brackets.

jacebenson commented 8 years ago

Not sure how to change Visual Studio Code, but it must be how it saves as this works fine with notepad, and Brackets.io.

dynamicdan commented 8 years ago

I'm not entirely sure what causes it but it is some kind of race condition to do with the file being emptied and then filesync seeing it and then the file being written out correctly. Sounds like atomic save logic but we actually have a solution to get around that. Maybe there is regression. I'll look into that.

jacebenson commented 8 years ago

I'm not sure how I can help, but if I can, let me know.