Repository navigation
Closed
Labels
enhancementNew feature or request
Description
Dead and duplicated code found in a grooming pass of main at b9c6c90. Each item keeps behavior when removed or merged; together they are more than 1 small grooming PR, so they are listed here for later passes.
Exported, but only tests call it (checked with grep -rn over cmd/, internal/, api/ and app/src/):
internal/store/search.go:51-86(*DB).Search: the same SQL asSearchNoteswith only a match;note.searchusesSearchNotes(internal/engine/note.go:123).search_test.gois its only caller.internal/store/vault.go:76-88(*DB).GetVault(vault_test.goonly).internal/vault/move.go:266-274retargetText(move_test.goonly;rewriteLinksusestargetSpan).internal/blobxfer/client.go:121-125(*Client).DownloadAll(client_test.goonly).internal/store/changes.go:55-62(*DB).PruneChanges(store_test.goonly). So thechangeslog is never pruned, and the broker's resync branch for a sequence older than the log (internal/events/broker.go:87-95) never triggers. That is the documented state today (notesd keeps the whole log); whether to keep the function for a later retention step or remove it is the owner's call.app/src/app/narrow.ts:8-9NARROW: onlynarrow.test.tsximports it; the app usesuseNarrow.
Duplicates:
internal/blobs/blobs.go:70-104Putand:111-146PutWant: the same temp file, hash, sync and publish steps; only the ID check differs.internal/store/queries.go:88-99andinternal/store/search.go:203-207: the same nested-tagEXISTSclause (tags.folded = ? OR (tags.folded >= ? AND tags.folded < ?)).internal/vault/backlinks.go:75-77validandinternal/vault/write.go:74showText: the same function in 1 package.internal/syncer/loop.go:1314-1317ignoredandinternal/syncer/service.go:430-433vaultPathHeld: 1 lookup and its negation;vault.Author{Source: api.VersionSourceSync, Name: "sync"}is written out 5 times inloop.go.cmd/notesctl/:if written, err := clix.OutputJSON(x); err != nil || written { return err }in 23 places.app/src/app/MainWindow.tsx:190-210and:248-266: the side pane'sPaneTabs,PaneandVaultRowblock, once for the wide layout and once for the drawer.app/src/app/menus.ts:34-40andapp/src/app/panes/files.tsx:214-219: the sameitem()menu helper.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or request
Activity