Mystify7777 / Mystify7777/devlens
Console: preserve Error stack from multi-argument calls
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 0
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
Goal
Improve Console event diagnostics when an Error is logged as an argument after the first argument, without changing the existing Console event shape or passthrough behavior.
Current gap
normalizeConsoleCall() currently derives message and stack only from the first argument. Therefore:
console.error("Request failed", error);
produces the useful message but loses error.stack, even though the full argument array is retained in metadata.args.
The normalizer itself documents this as a deferred v2 TODO.
Proposed scope
Investigate and implement the narrowest deterministic rule for Error extraction across the argument list.
The implementation should answer before coding:
- Should the first
Erroranywhere in the arguments supplystackwhen the first argument is not an Error? - Should its message affect the event
message, or should message remain strictly tied to the first argument per ADR-0007? - What should happen when multiple Error instances are present?
- Should subclassed/custom Error objects behave the same as ordinary
Errorinstances? - Does scanning arguments introduce any meaningful compatibility or performance concern for the five intercepted console methods?
Preserve the existing ADR-0007 contract unless evidence justifies an amendment:
messageremains based on the first argument,metadata.argsremains the full structured argument list,- original console method runs first and unconditionally,
- reporting reentrancy protection remains unchanged,
- normalization bugs are not swallowed by the EventBus failure catch.
Tests
Add focused tests covering:
- Error as second argument,
- Error later in the argument list,
- multiple Errors with the chosen deterministic rule,
- no Error in arguments,
- first argument already being an Error,
- existing message semantics remaining unchanged.
Run full workspace verification before commit.
Out of scope
- New console methods.
- Object snapshotting/immutability semantics, which are tracked separately in Issue #19.
- Generic argument serialization.
- Panel visual changes.
Do not commit until the implementation and tests are reviewed.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with normalizeConsoleCall() and ADR-0007 to understand the existing first-argument message, metadata.args, passthrough, and reentrancy contracts. Add focused tests for Error positions, multiple Errors, no Error, and unchanged message semantics, then run full workspace verification; done means the deterministic extraction rule is implemented without changing the stated contracts.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- devtools
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100