What event happen and what API can use?

hi: when the folder set master , other device change the file that have synchronize , the master device which evevt will happen ? which API that i can “Override Changes” ?

Good question. It’s the /rest/db/override endpoint, which seems to be missing from the documentation. POST to it with ?folder=folderID as a query parameter. On the event side, look for FolderSummary.

1,"/rest/db/override" endpoint , this isn’t public API ? i didn’t found it in “Database Endpoints” ! 2,when the master folder “FolderSummary” enent happen ,that mean other device have change the synchronize files ? i can post the “/rest/db/override” to change the files to old status ?

It’s as public as anything, we’ve just forgotten to document it, apparently. The FolderSummary is emitted when the amount of data in, or needed by, a folder has changed. In this case, since it’s a master folder it should not need data from anyone else. So in that event, needBytes > 0 should indicate that you’re out of sync and can use the override if you like.

thanks Borg: i will write code according to you tell !! recently i wirte code that use API to control the syncthing , but now , i found ,perhaps the syncthing should add some folder model ! why i say this ? just now ,i test the syncthing with three device , one folder is master ,other is ordinary , i hope , the master’s file couldn’t change by other device ,but when other device change synchronized files , the ordinary device also changed , this isn’t i hope ,at last i use the master device override the change ,that mean all change will pass by the master device , that’s so inefficiency , all data will get through the master device again , isn’t it ?

Potentially, but you if you behave well and don’t modify the data where you are not supposed to, you won’t get into this state

1 Like

if someone use one device attack the syncthing ? the syncthing will in what status ? will always transmitall data ?

now , i think the syncthing’s folder model isn’t rigorous folder model !

I’m not sure what you mean, exactly?

when i change the ordinary device 's file name , the master device notifiy the FolderSummary event , but couldn’t override the file that by change file name !

I’m still not really sure what you mean, sorry.

Borg: which IM you use ,can you give me your IM , i want to direct talk to you , this is my email , if you can give me your IM ,please send to my Email :sunylat@163.com , thank you !

No thanks, this is about as realtime as it gets for me. Other stuff ongoing as well, such as work. :wink:

It’s by design, and yes, everyone would get data from the master as the override happens. There is a pull request in progress which makes more efficient by sharing partial data between the devices.

Override should rename the file back.

OK , then we talk at here ! the syncthing is good work , i decide use it in the future ! before i have use the BTSync ,i think the BTSync’s model good then the syncthing ,below is the reason: 1,Simple:any node only need the key ,didn’t need other , the node can accept the p2p system ! 2,more safety:this better then the syncthing , in the BTSync , if the mode is readonly , the node only can accept other node change ,but this node’s change didn’t affect other node ,this is very important ! because i think the readonly p2p node should only work for itself, couldn’t affect by other node !

the p2p system perhaps attack by someone , the BTSync’s readonly can avoid attack !! if the node is readonly , whether how change the files that in this node ,it wouldn’t affect other node !! i think this is better model !!

Which property decide the device is the master ?

i found an question , when other node change the synchronize file’s name , the master device get the change ,but couldn’t override the file !

There is a readOnly property on folder section in the config to indicate that this device will refuse any updates from anyone.

I understand how BTSync works, but this is not how syncthing works, and if that doesn’t suit your needs, feel free to go back to BTSync.

It should, I will test it at home.

thank you AudriusButkevicius !