checkPostSyncIntegrity checks for data integrity issues after sync and warns the user
(db *database.DB)
| 881 | |
| 882 | // checkPostSyncIntegrity checks for data integrity issues after sync and warns the user |
| 883 | func checkPostSyncIntegrity(db *database.DB) { |
| 884 | count, orphans, err := findOrphanedNotes(db) |
| 885 | if err != nil { |
| 886 | log.Debug("error checking orphaned notes: %v\n", err) |
| 887 | return |
| 888 | } |
| 889 | |
| 890 | if count == 0 { |
| 891 | return |
| 892 | } |
| 893 | |
| 894 | log.Warnf("Found %d orphaned notes (referencing non-existent or deleted books):\n", count) |
| 895 | for _, o := range orphans { |
| 896 | log.Plainf(" - note %s (missing book: %s)\n", o.noteUUID, o.bookUUID) |
| 897 | } |
| 898 | } |
| 899 | |
| 900 | func sendNotes(ctx context.DnoteCtx, tx *database.DB) (bool, error) { |
| 901 | isBehind := false |
no test coverage detected