MCPcopy Index your code
hub / github.com/dnote/dnote / checkPostSyncIntegrity

Function checkPostSyncIntegrity

pkg/cli/cmd/sync/sync.go:883–898  ·  view source on GitHub ↗

checkPostSyncIntegrity checks for data integrity issues after sync and warns the user

(db *database.DB)

Source from the content-addressed store, hash-verified

881
882// checkPostSyncIntegrity checks for data integrity issues after sync and warns the user
883func 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
900func sendNotes(ctx context.DnoteCtx, tx *database.DB) (bool, error) {
901 isBehind := false

Callers 1

newRunFunction · 0.85

Calls 4

DebugFunction · 0.92
WarnfFunction · 0.92
PlainfFunction · 0.92
findOrphanedNotesFunction · 0.85

Tested by

no test coverage detected