fix: events typings#362
Conversation
Signed-off-by: Krishna Waske <krishna.waske@ayanworks.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughThree files were modified to implement tenant-aware DIDComm module access. The credential and proof event handlers were refactored to derive tenant IDs and use scoped agent connections, while CLI agent configuration was updated with peer DID algorithm settings and a logging change. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/cliAgent.ts`:
- Around line 557-558: The startup log includes accidental debug text; update
the logger call in the app.listen callback (where app.listen(adminPort, ...) is
invoked) to remove "hacked my way in" and emit a clean message like
"Successfully started server on port ${adminPort}" using the existing
logger.info call so production logs contain no stray debug text.
- Around line 213-214: The object literal for the connections configuration is
missing a trailing comma after the last property; add a trailing comma after
peerNumAlgoForDidRotation: PeerDidNumAlgo.ShortFormAndLongForm in the
connections object to satisfy Prettier/linting (referencing the properties
peerNumAlgoForDidExchangeRequests and peerNumAlgoForDidRotation in
src/cliAgent.ts).
In `@src/events/CredentialEvents.ts`:
- Around line 25-37: The default (non-tenant) branch uses
agent.modules.didcomm.connections.getById which throws if the connection is
missing; change it to the non-throwing lookup used in the tenant branch by
calling agent.modules.didcomm.connections.findById(record.connectionId) (or
findById(record.connectionId ?? '')) so connectionRecord can be null instead of
throwing; keep the existing connectionRecord variable and the subsequent
body.outOfBandId assignment unchanged.
In `@src/events/ProofEvents.ts`:
- Around line 12-22: The code in ProofEvents uses
event.metadata.contextCorrelationId.split(...) without checking that
event.metadata and contextCorrelationId exist, causing a crash and skipping the
default-agent branch; update the guard to first check event.metadata &&
event.metadata.contextCorrelationId (or use optional
chaining/event.metadata?.contextCorrelationId) before calling split, and only
call tenantAgent.modules.didcomm.proofs.getFormatData(record.id) for the tenant
branch when that check passes; otherwise fall through to the existing default
branch that calls agent.modules.didcomm.proofs.getFormatData(record.id) so proof
events without a tenant correlation id still emit the default webhook.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 480507d5-c9b5-43a7-bdcd-a20f0054adea
📒 Files selected for processing (3)
src/cliAgent.tssrc/events/CredentialEvents.tssrc/events/ProofEvents.ts
Signed-off-by: Krishna Waske <krishna.waske@ayanworks.com>
Signed-off-by: Krishna Waske <krishna.waske@ayanworks.com>
Signed-off-by: Krishna Waske <krishna.waske@ayanworks.com>
Signed-off-by: Krishna Waske <krishna.waske@ayanworks.com>
|



What:
Summary by CodeRabbit
Bug Fixes
Chores