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

Merged
David merged 1 commit from fix/bunyip-76 into main 2026-06-13 13:36:01 +02:00
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

Branch-backed replacement for #117 (original was AGit/branchless). NOTE: this branch CONFLICTS with current main and needs a manual rebase / conflict resolution before it can merge, but it is now branch-backed so "Update Branch" and normal merge flow apply.

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 Branch-backed replacement for #117 (original was AGit/branchless). NOTE: this branch CONFLICTS with current main and needs a manual rebase / conflict resolution before it can merge, but it is now branch-backed so "Update Branch" and normal merge flow apply.
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 force-pushed fix/bunyip-76 from acebb4c081
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
to 8021d5d2a5
All checks were successful
Check / fmt / clippy / build / test (pull_request) Successful in 1m24s
Create release / Create release from merged PR (pull_request) Has been skipped
2026-06-13 13:23:49 +02:00
Compare
David merged commit 0818659e9f into main 2026-06-13 13:36:01 +02:00
David deleted branch fix/bunyip-76 2026-06-13 13:36:01 +02:00
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!136
No description provided.