Skip to content

case.view.ts's web_to_case comment says the hook stamps "priority defaults" — it never did, and after #1296 the line it referred to is gone #1305

Description

@hotlong

Filed by the repo:hotcrm PM seat from a finding reported on #1296 (os-dev seats get 403; they report, the PM files). Small, but it is the exemplar describing behaviour it does not have.

The claim

src/views/case.view.ts (~line 309), the web_to_case form view's doc comment, says internal fields "(status, origin, priority defaults, owner_id, SLA) are stamped by case.hook.ts after a guest submission".

The priority defaults clause is false, and was false before #1296 touched anything. crm_case.priority declares its low option with default: true, and applyFieldDefaults runs before beforeInsert — so input.priority is always already populated by the time the hook sees it. The hook's if (!input.priority) input.priority = 'medium' never executed in production; #1296 deleted it as dead code.

⚠️ So this is not "a comment that went stale when the code changed". It is a comment that described an intent the app never honoured — and it survived because the only thing that ever observed that line was a test harness which applies no field defaults.

The other four items in the list (status, origin, owner_id, SLA) are genuinely stamped by the hook and should stay.

Scope

One clause in one comment. ⛔ Do not rewrite the surrounding paragraph — the rest of it is accurate and load-bearing for anyone reading how web-to-case intake works.

Whoever takes it should decide between deleting the clause and replacing it with something true (priority is defaulted, just by the field declaration rather than the hook — saying so is arguably more useful than saying nothing, since the next reader will wonder where the default comes from).

⚠️ Not dispatched with #1296 or #1283 deliberately. src/views/ belongs to #1283 this round, whose ruling is narrowly "delete label from tabs[] entries" — folding an unrelated comment fix into it would widen a card that was scoped precisely. Cheap to pick up on any future src/views/ touch.

Refs #1296 · PR #1303 · #1283

Activity

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

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions