feat: define reporting service contracts and dispatchers#1224
feat: define reporting service contracts and dispatchers#1224alexs-mparticle wants to merge 13 commits intodevelopmentfrom
Conversation
…dule - Define IErrorReportingService, ILoggingService, ISDKError, ISDKLogEntry contracts - Add ErrorReportingDispatcher and LoggingDispatcher for multi-service fan-out - Decouple Logger from reporting (console-only now) - Remove concrete ReportingLogger implementation (moves to kit) - Remove Rokt-specific URLs from constants - Rename src/logging/ to src/reporting/ - Expose registerErrorReportingService/registerLoggingService on mParticle API
PR SummaryMedium Risk Overview Decouples Wires the new dispatchers into Written by Cursor Bugbot for commit f153c27. This will update automatically on new commits. Configure here. |
- Add optional chaining for _ErrorReportingDispatcher in identityApiClient so tests without a mock dispatcher don't crash - Add registerErrorReportingService and registerLoggingService to the expected public API keys in instance manager test
This reverts commit e573c1f.
…ning Reverts optional chaining on _ErrorReportingDispatcher.report() which was masking potential bugs. Instead, properly adds ErrorReportingDispatcher instances to all mock mpInstance objects in identity API client tests.
…uctor - Wrap each service call in try-catch in ErrorReportingDispatcher and LoggingDispatcher so one failing service doesn't break fan-out - Move dispatcher instantiation from runPreConfigFetchInitialization to mParticleInstance constructor so registration works before init() - Destructure errorReporter in identityApiClient for cleaner usage
Rename registerErrorReportingService/registerLoggingService to _registerErrorReportingService/_registerLoggingService to signal these are internal APIs consumed by kits, not public.
Pass ErrorReportingDispatcher and LoggingDispatcher into RoktManager.init() from mp-instance. Add INFO log on kit attach (ROKT_KIT_ATTACHED) and WARNING reports on identity mismatch (IDENTITY_MISMATCH) alongside existing logger.warning calls. Add new error codes to reporting types.
… mocks The identity API client test mocks were missing _ErrorReportingDispatcher, causing a TypeError when report() was called on 5xx errors. Added optional chaining to the call site and added the mock to both test cases.
Merge development into feat/reporting-service-migration-core, resolving conflicts in dist/ bundle files by accepting development's versions (CI will regenerate these after merge).
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.




Summary
IErrorReportingServiceandILoggingServiceinterfaces insrc/reporting/types.tsErrorReportingDispatcherandLoggingDispatcherfor multi-service fan-outLoggerfrom reporting — Logger is now console-onlyReportingLoggerimplementation (moves to Rokt kit)src/logging/tosrc/reporting/registerErrorReportingService()andregisterLoggingService()on mParticle APICompanion kit PR: mparticle-integrations/mparticle-javascript-integration-rokt#70
Test plan
window.mParticle