dynamicdan / sn-filesync

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

Same named files are overridden from a different File Record #54

Open liny01-nbsa opened 1 year ago

liny01-nbsa commented 1 year ago

Hi @dynamicdan,

Thank you for making and maintaining this very useful tool.

I'm running into a weird issue, I have the following (simplified) folder records:

└───ui_actions
    ├───table1
    │   └───client_true
    │       └───process.js  # (file 1)
    └───table2
        └───client_true
            └───process.js  # (file 2)

There are 2 same named UI Actions that's associated with 2 different tables. When a --resync is done. file 1 would be override with the content of file 2. This can be fixed by a pull-down of only file 1 again.

dynamicdan commented 1 year ago

Hi @liny01-nbsa, There is an option to save the sys_id in the file name. You can set "ensureUniqueNames" in your config. Please see if this rectifies the issue. I'm not investing much time into sn-filesync right now so if you can debug more into what's happening then I can perhaps provide a better fix. Also, please double check the .sync_data folder to see if the correct data is saved there. IIRC, the app should be looking up the relevant meta data file to decide what record to pull down. It could be that both table1 and table2 folders have the same sys_id in the meta data file for some reason. If the data is correct, then there is a bug in the app logic. I hope that helps.