Feature/5895 store all incoming documents in sync db

You are right that we'll need to pass them here. I don't have an answer for that yet, but will provide one soon.