Migrated from Method backlog
GitHub Issues are now the live work tracker. Repository docs remain Method evidence.
| Field |
Value |
| Source backlog |
docs/method/backlog/bad-code/BND_patch-session-message-parsing.md |
| Archived source |
docs/archive/backlog/github-issue-migration-2026-06-01/docs/method/backlog/bad-code/BND_patch-session-message-parsing.md |
| Original lane |
bad-code |
| Original id |
BND_patch-session-message-parsing |
| Original legend |
BND |
| Original feature |
observer-admission-runtime |
| Original release home |
v19.0.0 |
Original backlog card
PatchSession classifies errors by parsing err.message
Effort: S
What's Wrong
PatchSession._classifyCommitError() uses errMsg.includes('Concurrent commit detected') and errMsg.includes('has advanced') to classify errors. This is the "raccoon in a dumpster" anti-pattern from SSJS doctrine — behaviorally significant branching driven by string matching on human-readable text. If anyone rewords the message, the classification silently breaks.
Error type should be primary, not message content.
Suggested Fix
Introduce ConcurrentCommitError and RefAdvancedError classes extending the appropriate domain error base. Throw those from the origin sites. Replace _classifyCommitError() string matching with instanceof dispatch (P7).
Migrated from Method backlog
GitHub Issues are now the live work tracker. Repository docs remain Method evidence.
docs/method/backlog/bad-code/BND_patch-session-message-parsing.mddocs/archive/backlog/github-issue-migration-2026-06-01/docs/method/backlog/bad-code/BND_patch-session-message-parsing.mdbad-codeBND_patch-session-message-parsingBNDobserver-admission-runtimev19.0.0Original backlog card
PatchSession classifies errors by parsing err.message
Effort: S
What's Wrong
PatchSession._classifyCommitError()useserrMsg.includes('Concurrent commit detected')anderrMsg.includes('has advanced')to classify errors. This is the "raccoon in a dumpster" anti-pattern from SSJS doctrine — behaviorally significant branching driven by string matching on human-readable text. If anyone rewords the message, the classification silently breaks.Error type should be primary, not message content.
Suggested Fix
Introduce
ConcurrentCommitErrorandRefAdvancedErrorclasses extending the appropriate domain error base. Throw those from the origin sites. Replace_classifyCommitError()string matching withinstanceofdispatch (P7).