fix(bunyip-domain): correct repository SQL binding, silent no-ops, and dead methods #117

Closed
David wants to merge 1 commit from david/fix/bunyip-domain-repo-sql-binding-and-dead-methods into main AGit
Owner

Rebuild the admin paginated/count queries with sqlx::QueryBuilder so placeholders always match bindings: user.rs list_paginated count query bound $1/$2 against $3/$4 placeholders, and audit.rs list_paginated emitted unbound $3/$4 filters, so admin user-search and audit filtering 500'd at runtime. Remove the now-redundant audit list_admin_actions duplicate (its hard-coded admin filter is covered by list_paginated's admin_only path) and its dead dynamic-filter scaffolding.

Make application.rs writers report not-found honestly: set_requires_entitlement, set_maintenance_mode, set_active, update_version and swap_sort_order now check rows_affected and return AppError::not_found instead of silently succeeding against unknown ids.

Collapse duplicated/dead code: merge stripe.rs update_encryption into update (rotation callers pass updated_by + new key_version, app_tag None); drop the find_active_refresh_tokens_for_user alias and repoint its one caller to find_user_refresh_tokens; remove the unused StripeSubscriptionStatus, PaymentStatus, and CreateFeedbackRequest DTOs and their re-exports; move UpdateApplication ahead of the #[cfg(test)] block so its tests compile.

TotpRepository now returns AppError like every sibling repository, and insert_recovery_codes uses one QueryBuilder::push_values multi-row INSERT instead of N round-trips. feedback.rs save_attachments wraps its inserts in a transaction. mask_secret keeps the key prefix when prefix_end + 4 <= len. free_price_id is read through a single config::free_price_id_from_env helper shared by TierConfig and StripeConfig so they cannot diverge. The lifetime_member doc comment now references the lifetime_slots config (default 5).

#BUNYIP-76

Rebuild the admin paginated/count queries with sqlx::QueryBuilder so placeholders always match bindings: user.rs list_paginated count query bound $1/$2 against $3/$4 placeholders, and audit.rs list_paginated emitted unbound $3/$4 filters, so admin user-search and audit filtering 500'd at runtime. Remove the now-redundant audit list_admin_actions duplicate (its hard-coded admin filter is covered by list_paginated's admin_only path) and its dead dynamic-filter scaffolding. Make application.rs writers report not-found honestly: set_requires_entitlement, set_maintenance_mode, set_active, update_version and swap_sort_order now check rows_affected and return AppError::not_found instead of silently succeeding against unknown ids. Collapse duplicated/dead code: merge stripe.rs update_encryption into update (rotation callers pass updated_by + new key_version, app_tag None); drop the find_active_refresh_tokens_for_user alias and repoint its one caller to find_user_refresh_tokens; remove the unused StripeSubscriptionStatus, PaymentStatus, and CreateFeedbackRequest DTOs and their re-exports; move UpdateApplication ahead of the #[cfg(test)] block so its tests compile. TotpRepository now returns AppError like every sibling repository, and insert_recovery_codes uses one QueryBuilder::push_values multi-row INSERT instead of N round-trips. feedback.rs save_attachments wraps its inserts in a transaction. mask_secret keeps the key prefix when prefix_end + 4 <= len. free_price_id is read through a single config::free_price_id_from_env helper shared by TierConfig and StripeConfig so they cannot diverge. The lifetime_member doc comment now references the lifetime_slots config (default 5). #BUNYIP-76
fix(bunyip-domain): correct repository SQL binding, silent no-ops, and dead methods
All checks were successful
Create release / Create release from merged PR (pull_request) Has been skipped
Check / fmt / clippy / build / test (pull_request) Successful in 1m8s
acebb4c081
Rebuild the admin paginated/count queries with sqlx::QueryBuilder so placeholders always match bindings: user.rs list_paginated count query bound $1/$2 against $3/$4 placeholders, and audit.rs list_paginated emitted unbound $3/$4 filters, so admin user-search and audit filtering 500'd at runtime. Remove the now-redundant audit list_admin_actions duplicate (its hard-coded admin filter is covered by list_paginated's admin_only path) and its dead dynamic-filter scaffolding.

Make application.rs writers report not-found honestly: set_requires_entitlement, set_maintenance_mode, set_active, update_version and swap_sort_order now check rows_affected and return AppError::not_found instead of silently succeeding against unknown ids.

Collapse duplicated/dead code: merge stripe.rs update_encryption into update (rotation callers pass updated_by + new key_version, app_tag None); drop the find_active_refresh_tokens_for_user alias and repoint its one caller to find_user_refresh_tokens; remove the unused StripeSubscriptionStatus, PaymentStatus, and CreateFeedbackRequest DTOs and their re-exports; move UpdateApplication ahead of the #[cfg(test)] block so its tests compile.

TotpRepository now returns AppError like every sibling repository, and insert_recovery_codes uses one QueryBuilder::push_values multi-row INSERT instead of N round-trips. feedback.rs save_attachments wraps its inserts in a transaction. mask_secret keeps the key prefix when prefix_end + 4 <= len. free_price_id is read through a single config::free_price_id_from_env helper shared by TierConfig and StripeConfig so they cannot diverge. The lifetime_member doc comment now references the lifetime_slots config (default 5).

#BUNYIP-76
David closed this pull request 2026-06-12 11:59:53 +02:00
All checks were successful
Create release / Create release from merged PR (pull_request) Has been skipped
Check / fmt / clippy / build / test (pull_request) Successful in 1m8s

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
psa-systems/bunyip!117
No description provided.