             i = patches.length - 1
             while i > 0
                 if patches[i].is_first
+                    if i > 0
+                        winston.debug("some older patches are no longer needed -- deleting from DB")
+                    for p in patches.slice(0,i)
+                        @db.delete
+                            table : 'syncstrings'
+                            where :
+                                string_id : string_id
+                                timestamp : p.timestamp
                     patches = patches.slice(i)
                     break
                 i -= 1


    # DO NOT CHANGE THESE TWO FUNCTIONS, ever!  It'll break everything in the db
    patch_to_string: (patch) => JSON.stringify(diffsync.compress_patch(patch))
    string_to_patch: (patch) => diffsync.decompress_patch(JSON.parse(patch))

    dbg: (f, m) =>
        winston.debug("StringsDB.#{f}: #{m}")

        # turns out to be sensible.
        #  SIMPLIFIED: ignore is_first and never trim.
        @dbg("_process_updates", "process #{updates.length} updates")
        #@dbg("_process_updates", "#{misc.to_json(updates)}")
        new_patches = {}
        for update in updates
            update.timestamp = update.timestamp - 0  # better to key map based on string of timestamp as number
