fix: correct rmm, notifications, SLA, KB, portal, and contacts defects #217

Merged
David merged 2 commits from fix/pms-195-module-correctness-defects into main 2026-06-14 00:20:49 +02:00
Owner

Address nine per-module correctness defects:

  • rmm/routes.rs: verify the agent HMAC over the original raw request bytes instead of re-serialised JSON, so valid signatures survive field reordering, whitespace, and unknown keys.
  • rmm/service.rs: drop the legacy direct-INSERT ticket path and make TicketService a required dependency so every RMM-originated ticket routes through validation, automation, audit, and notifications.
  • notifications/service.rs: return NotFound on a nonexistent or cross-user mark_read, and batch-load recipient preferences with ANY($2) to remove the N+1 query in the dispatch fan-out.
  • sla/service.rs: clear other defaults in update_business_hours so at most one business-hours row stays is_default.
  • knowledge_base/routes.rs: gate create_article / update_article behind RequireManager, consistent with the category routes.
  • knowledge_base/service.rs: bump view_count only on public reads; internal create/update/restore refetches no longer double-count.
  • portal/middleware.rs: hydrate first_name / last_name from the contacts row after decoding the token so /me returns populated names.
  • contacts/service.rs: parse the stored preferred_contact_method instead of hardcoding Email.

#PMS-195

Address nine per-module correctness defects: - rmm/routes.rs: verify the agent HMAC over the original raw request bytes instead of re-serialised JSON, so valid signatures survive field reordering, whitespace, and unknown keys. - rmm/service.rs: drop the legacy direct-INSERT ticket path and make TicketService a required dependency so every RMM-originated ticket routes through validation, automation, audit, and notifications. - notifications/service.rs: return NotFound on a nonexistent or cross-user mark_read, and batch-load recipient preferences with ANY($2) to remove the N+1 query in the dispatch fan-out. - sla/service.rs: clear other defaults in update_business_hours so at most one business-hours row stays is_default. - knowledge_base/routes.rs: gate create_article / update_article behind RequireManager, consistent with the category routes. - knowledge_base/service.rs: bump view_count only on public reads; internal create/update/restore refetches no longer double-count. - portal/middleware.rs: hydrate first_name / last_name from the contacts row after decoding the token so /me returns populated names. - contacts/service.rs: parse the stored preferred_contact_method instead of hardcoding Email. #PMS-195
fix: correct rmm, notifications, SLA, KB, portal, and contacts defects
Some checks failed
E2E / Playwright against staging (pull_request) Failing after 41s
Check / fmt + clippy + compile + tests (pull_request) Failing after 3m57s
f5520f781a
Address nine per-module correctness defects:

- rmm/routes.rs: verify the agent HMAC over the original raw request bytes instead of re-serialised JSON, so valid signatures survive field reordering, whitespace, and unknown keys.
- rmm/service.rs: drop the legacy direct-INSERT ticket path and make TicketService a required dependency so every RMM-originated ticket routes through validation, automation, audit, and notifications.
- notifications/service.rs: return NotFound on a nonexistent or cross-user mark_read, and batch-load recipient preferences with ANY($2) to remove the N+1 query in the dispatch fan-out.
- sla/service.rs: clear other defaults in update_business_hours so at most one business-hours row stays is_default.
- knowledge_base/routes.rs: gate create_article / update_article behind RequireManager, consistent with the category routes.
- knowledge_base/service.rs: bump view_count only on public reads; internal create/update/restore refetches no longer double-count.
- portal/middleware.rs: hydrate first_name / last_name from the contacts row after decoding the token so /me returns populated names.
- contacts/service.rs: parse the stored preferred_contact_method instead of hardcoding Email.

#PMS-195
Merge origin/main into fix/pms-195-module-correctness-defects
Some checks failed
E2E / Playwright against staging (pull_request) Failing after 43s
Check / fmt + clippy + compile + tests (pull_request) Successful in 3m4s
Create release / Create release from merged PR (pull_request) Has been skipped
0c7f45d82c
#PMS-195
David merged commit 69bdf0a15a into main 2026-06-14 00:20:49 +02:00
David deleted branch fix/pms-195-module-correctness-defects 2026-06-14 00:20:49 +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/mokosh-server!217
No description provided.