Skip to content

fix: events typings#362

Merged
GHkrishna merged 5 commits intofeat/oidc-main-syncfrom
fix/event-emmit
Apr 16, 2026
Merged

fix: events typings#362
GHkrishna merged 5 commits intofeat/oidc-main-syncfrom
fix/event-emmit

Conversation

@GHkrishna
Copy link
Copy Markdown
Contributor

@GHkrishna GHkrishna commented Apr 16, 2026

What:

  • Fix changes in event emitted for issuance and verification.

Summary by CodeRabbit

  • Bug Fixes

    • Credential events now properly handle multi-tenant configurations by routing requests through tenant-scoped agents and retrieving credential format data with tenant awareness.
    • Proof events enhanced with tenant-aware format data retrieval to accurately process multi-tenant scenarios.
    • DIDComm module connection handling improved with updated DID algorithm configuration.
  • Chores

    • Updated REST agent startup logging.

Signed-off-by: Krishna Waske <krishna.waske@ayanworks.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 16, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f65b4b88-ce5d-4cbf-82db-fdff4df6d9c5

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Three 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

Cohort / File(s) Summary
CLI Configuration
src/cliAgent.ts
Added PeerDidNumAlgo import and configured DIDComm connections with GenesisDoc and ShortFormAndLongForm peer DID algorithms. Updated startup log message with appended text.
Credential Events Handler
src/events/CredentialEvents.ts
Refactored to derive tenantId from context correlation ID and implemented tenant-aware connection lookup and credential format data retrieval using scoped tenantAgent when non-default tenants are detected.
Proof Events Handler
src/events/ProofEvents.ts
Switched proof format data retrieval to use modules.didcomm.proofs instead of root proofs module, with tenant-scoped access for non-default tenants.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • fix: proof controller #360: Overlaps with changes to tenant-aware calls to agent.modules.didcomm.proofs.getFormatData and DIDComm proofs namespace usage.
  • fix: credential controller #359: Related through concurrent modifications to DIDComm credential and proof handling with tenant-scoped didcomm access patterns.

Suggested labels

bug

Suggested reviewers

  • RinkalBhojani
  • sairanjit

Poem

🐰 Tenant-awareness now takes the stage,
DIDComm modules turn a new page,
Credentials and proofs, scoped just right,
Though "hacked my way in" seems... quite the sight! 🔐

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Title check ⚠️ Warning The title 'fix: events typings' does not accurately reflect the main changes in the PR, which involve significant refactoring of event handlers to support tenant-aware credential and proof data retrieval with DIDComm modules. Update the title to better reflect the actual changes, such as 'fix: make event handlers tenant-aware for DIDComm module integration' or 'refactor: add tenant support to credential and proof event handlers'.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/event-emmit

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@GHkrishna GHkrishna requested a review from RinkalBhojani April 16, 2026 06:05
@GHkrishna GHkrishna self-assigned this Apr 16, 2026
@GHkrishna GHkrishna added the enhancement This enhances the overall experience/code quality/flows, etc label Apr 16, 2026
@GHkrishna
Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 16, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 7fadfe6 and 4591ccd.

📒 Files selected for processing (3)
  • src/cliAgent.ts
  • src/events/CredentialEvents.ts
  • src/events/ProofEvents.ts

Comment thread src/cliAgent.ts Outdated
Comment thread src/cliAgent.ts Outdated
Comment thread src/events/CredentialEvents.ts
Comment thread src/events/ProofEvents.ts Outdated
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>
@sonarqubecloud
Copy link
Copy Markdown

@GHkrishna GHkrishna merged commit 306c524 into feat/oidc-main-sync Apr 16, 2026
5 checks passed
@GHkrishna GHkrishna deleted the fix/event-emmit branch April 16, 2026 10:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement This enhances the overall experience/code quality/flows, etc

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants