FFFF Design: smaller consistency items · Issue #306 · alexbeeken/skrongle-mini · GitHub
[go: up one dir, main page]

Skip to content

Design: smaller consistency items #306

Backlog

Description

@alexbeeken

Each is one small PR, or rides along with a bigger one.

  • Nested results. Db::call only takes rusqlite::Result<T>, so a refusal travels as rusqlite::Result<Result<T, E>>: 15 signatures and 61 Ok(Err( sites (oauth_server.rs, auth/api.rs, perms.rs:211, signup.rs:162, owner.rs:191, routes/courses/write.rs:78). Make Db::call generic over E: From<rusqlite::Error>.
  • Notices. The key-in-the-URL design is good, but the parameter is notice (courses, share), did (manage) or saved (profile), and Redirect::to(&crate::url( is written 71 times. A routes::see(path) helper and one parameter name.
  • The pass threshold is written twice. guide::stars_for hard-codes 0.7 (src/guide.rs:33) beside PASS_PCT. progress::run_passes ignores via while record_run_at uses required_answers_via.
  • The session query is read by position, with three NULL placeholders and r.get(14), r.get(17) (src/auth.rs:393-431). Named constants, or drop the dead columns.
  • The progress cache leaks into a handler: "Read first, outside the transaction, so the progress cache fills" (src/routes/pages.rs:738). The write helper from the learning-writes issue should own that ordering.
  • courses::CHECK_HOOK (src/courses.rs:1276) is a test-only global that four test files push and remove with no drop guard.
  • "conjugation" is a literal at src/routes/games.rs:732 beside the GAME_* constants.

Worth keeping as they are (so nobody "fixes" them): one connection behind Db::call with domain functions shaped fn(conn, user_id, course_id, …); progress.rs as the only writer of lesson_passes; the CurrentUser → Project extractors; caps.rs fixing sizes instead of exposing settings; up and down migrations with the tests that check them; integer Unix seconds everywhere; every token stored hashed; the x() / x_at(…, at) pairs for testable time; notices keyed in the URL with no server-side state.

From the code review of 24 November 2026. Line numbers are as of 0.5.0 (2547b36).

Activity

  1. added
    review
    on Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    review

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0