   # Possible situations: TODO
   # ------------------------------------------------------------
   _merge_remote_notes: (notes) =>
+    guid_list = (note['guid'] for note in notes)
+    console.log('start merging remote notes: ' + JSON.stringify(guid_list))
+
+    must_finish_promise_list = []
+    remote_note_guid_list = []
+
     # Phase one: patch remote notes to local
-    remote_note_guid_list = []
     for note_meta in notes
       remote_note_guid_list.push(note_meta['guid'])
       do (note_meta) =>

        console.log('find_note_by_guid(' + guid + ') returned null')
        return null
      else
        console.log('find_note_by_guid(' + guid + ') hit: ' + JSON.stringify(notes[0]))
        return notes[0]

  # ------------------------------------------------------------

# ----------------------------------------------------------------------------------------------------------------------
# Service: noteManager
# ----------------------------------------------------------------------------------------------------------------------
markever.factory 'noteManager',
['dbProvider', 'apiClient', 'imageManager',
(dbProvider, apiClient, imageManager) -> new class NoteManager

  # Status of a note:
  # 1. new: note with a generated guid, not attached to remote
