4.4 KiB
TODO
Note: These todos can wait until all the subcommands have been ported.
HIGH
-
db.odin:380-383, 405, 446 —
sqlite.bind_textreturn values overwritten but never checked. A failed bind meanssqlite.stepoperates on unbound params. -
config.odin:52-54 —
os.user_home_direrror silently ignored. If it fails,homeis""and all paths become relative (".envr"instead of"~/.envr").
MEDIUM
-
db.odin:29-35 —
make_temp_pathnever callsstrings.builder_destroy. Leaks builder buffer every call. -
db.odin:324-327 — Map iteration (
remote_set) is non-deterministic. Same file can produce different JSON on each backup, causing spurious DB diffs. Sort remotes before storing. -
db.odin:470-473 —
string_to_cstringallocates viastrings.clone_to_cstringand never frees. Called dozens of times across db operations. -
db.odin:470, 462 — Both
string_to_cstringandcstring_to_stringignore allocation errors. A nil cstring gets passed to SQLite (UB). -
db.odin:135, 250 — String interpolation into SQL (
VACUUM INTO '%s',ATTACH DATABASE '%s'). Currently safe because input is controlled, but fragile. -
features.odin:30-41 —
find_binaryusesstrings.joininstead offilepath.join, usesos.statinstead of checking executability, hardcodes:as PATH separator (wrong on Windows). -
cmd_restore.odin:20-30 & cmd_remove.odin:19-29 — Identical path-resolution block copy-pasted.
is_absguard is redundant sincefilepath.absis a no-op on absolute paths. Extract a helper. -
cmd_restore.odin:44 —
os.mkdir_allerror silently discarded. Subsequent write failure will be confusing. -
cmd_edit_config.odin:27 —
$EDITORused as single binary name. Breaks for multi-word values like"code -w". Needsstrings.fields(). -
config.odin:178 —
search_pathssilently ignoresos.user_home_direrror. If home is empty,~isn't expanded. Same class of bug as issue 3. -
prompt.odin:124 —
make([dynamic]bool, len(options))creates N zero-initialized elements. Works becausefalseis the default, but same footgun as original issue 1. Should bemake([dynamic]bool, 0, len(options)). -
Lots of memory leaks to fix.
LOW
-
db.odin:115 —
json.unmarshal_stringerror not checked. Malformed JSON silently produces empty/partial data. -
db.odin:352-353 —
hex.encodeerror ignored.string(hex_bytes)aliases the byte slice. -
config.odin:51-60 —
envr_dirrecomputes home dir on every call. Could cache. -
cmd_sync.odin:80, cmd_list.odin:33, cmd_deps.odin:9 —
make([]string, 2)for table rows never freed. Leaks per row. Defer to memory pass.
REFACTOR
-
cmd_list.odin — Non-TTY branch builds
ListEntrystructs and marshals JSON separately. Now thatrender_json_rows(issue 1) accepts anio.Writerand usesjson.marshal, unify both branches to use it. Note: will change JSON keys from"directory"/"path"to"Directory"/"Path". -
Check for prealloc opportunities. i.e.
make([dynamic]string)->make([dynamic]string, 5). -
Add a text filter to the multi_select.
-
Create backup / fallback fd.
-
Add tests for untested commands.
-
Add a global --config -c flag to use an alternate config.
-
version --long Odin only prints version; Go also prints commit hash and build date
-
2 scan tests silently skip Low When fd isn't installed, tests pass without actually testing anything. These should use #assert to be sure that fd is in path.
-
Try to do all encryption / decryption in memory - only read / write encrypted data to disk.
-
use a buffered writer where possible (mem.DEFAULT_PAGE_SIZE)
Double-check AI output
- cli.odin
- cli_test.odin
- cmd_backup.odin
- cmd_check.odin
- cmd_check_test.odin
- cmd_deps.odin
- cmd_edit_config.odin
- cmd_init.odin
- cmd_list.odin
- cmd_list_test.odin
- cmd_nushell_completion.odin
- cmd_nushell_completion_test.odin
- cmd_remove.odin
- cmd_restore.odin
- cmd_scan.odin
- cmd_sync.odin
- cmd_version.odin
- config.odin
- config_test.odin
- crypto.odin
- crypto_test.odin
- db.odin
- db_integration_test.odin
- db_test.odin
- features.odin
- features_test.odin
- main.odin
- prompt.odin
- scan.odin
- scan_test.odin
- sodium.odin
- sqlite/sqlite.odin
- ssh.odin
- ssh_test.odin
- table.odin
- table_test.odin