Skip to content

fix(tdf3): remove TODO from customer-facing error message#952

Open
davidaronhopper-dev wants to merge 3 commits into
mainfrom
DSPX-3454
Open

fix(tdf3): remove TODO from customer-facing error message#952
davidaronhopper-dev wants to merge 3 commits into
mainfrom
DSPX-3454

Conversation

@davidaronhopper-dev

@davidaronhopper-dev davidaronhopper-dev commented Jun 22, 2026

Copy link
Copy Markdown

Summary

Fixes DSPX-3454 - removes TODO from customer-facing error message in Secure Viewer.

A customer reported seeing: "TODO: Fallback to no split ids. Repetition found for..." in error output when decryption failed.

Changes

  • Replaced customer-facing error with user-friendly message: "Unable to decrypt: Multiple keys detected for Key Access Server [URL]. Please contact your administrator."
  • Kept developer TODO as code comment for future implementation of split ID fallback logic

Impact

  • Customers no longer see internal TODO messages in error output
  • Developer context preserved in code comments for future work

Related

  • Follow-up ticket created: DSPX-3666 (audit codebase-wide for other customer-facing TODOs)

Summary by CodeRabbit

  • Bug Fixes
    • Improved validation error messaging for file configuration issues related to split key-to-URL mappings. When multiple keys resolve to the same URL within a split, users now see a clearer “Multiple keys detected” message with guidance to contact their administrator.

@davidaronhopper-dev davidaronhopper-dev requested a review from a team as a code owner June 22, 2026 20:52
@coderabbitai

coderabbitai Bot commented Jun 22, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@davidaronhopper-dev, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 19 minutes and 46 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 9ad708a1-3c40-4f0a-bf5d-8494308c779c

📥 Commits

Reviewing files that changed from the base of the PR and between 079c8f3 and 9bff8cc.

📒 Files selected for processing (2)
  • lib/tdf3/src/tdf.ts
  • lib/tests/mocha/unit/tdf.spec.ts
📝 Walkthrough

Walkthrough

In lib/tdf3/src/tdf.ts, the splitLookupTableFactory function's error handling for repeated KAS URLs within a split was updated: the InvalidFileError message changed from a TODO-style fallback phrase to "Multiple keys detected … Please contact your administrator", and the accompanying TODO comment now references repetition detection.

Changes

Error Message Update in splitLookupTableFactory

Layer / File(s) Summary
InvalidFileError message for repeated KAS URL
lib/tdf3/src/tdf.ts
Replaces the previous TODO-based fallback error text with a user-facing message ("Multiple keys detected … Please contact your administrator") and updates the internal TODO comment to describe the repetition detection scenario.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

A rabbit once found a key twice in a row,
And said "That's not right, to the admin you go!"
No more cryptic TODOs left lying around,
A cleaner error message is all that was found.
🐇✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title accurately describes the main change: removing a TODO from a customer-facing error message in the tdf3 module, which aligns with the code changes and PR objectives.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ 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 DSPX-3454

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.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request updates the error message thrown when duplicate Key Access Server (KAS) URLs are detected within a split, replacing a placeholder TODO error with a user-friendly message and adding a detailed TODO comment for future implementation. The review feedback suggests simplifying the multi-line template literal concatenation into a single template literal string to improve readability.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread lib/tdf3/src/tdf.ts Outdated
@github-actions

Copy link
Copy Markdown

If these changes look good, signoff on them with:

git pull && git commit --amend --signoff && git push --force-with-lease origin

If they aren't any good, please remove them with:

git pull && git reset --hard HEAD~1 && git push --force-with-lease origin

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@lib/tdf3/src/tdf.ts`:
- Around line 729-734: The error message thrown in the InvalidFileError for
duplicate KAS URLs has been changed, but the test assertion in
lib/tests/mocha/unit/tdf.spec.ts that validates this error message still expects
the old message format. Find the test that asserts on the error message for
duplicate KAS URL scenarios and update the expected string to match the new
error message about "Multiple keys detected for Key Access Server" that is now
being thrown in the InvalidFileError constructor call.
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 0c097966-ee22-4a84-8a6c-eba0c0a1ef51

📥 Commits

Reviewing files that changed from the base of the PR and between a0ad0c2 and 48e3bcb.

📒 Files selected for processing (1)
  • lib/tdf3/src/tdf.ts

Comment thread lib/tdf3/src/tdf.ts Outdated
davidaronhopper-dev and others added 3 commits June 22, 2026 16:32
Replace 'TODO: Fallback to no split ids' error with user-friendly message.
Keep developer TODO as code comment for future implementation.

Fixes DSPX-3454

Signed-off-by: Aaron Hopper <aaron.hopper@virtru.com>
Signed-off-by: Aaron Hopper <aaron.hopper@virtru.com>
Update test to match new customer-friendly error message.

Signed-off-by: Aaron Hopper <aaron.hopper@virtru.com>
@sonarqubecloud

Copy link
Copy Markdown

Comment thread lib/tdf3/src/tdf.ts
for (const kao of keyAccess) {
const disjunction = splitPotentials[kao.sid ?? ''];
if (kao.url in disjunction) {
// TODO(DSPX-3454): Implement fallback to no split ids when repetition is detected.

@ntrevino-virtru ntrevino-virtru Jun 22, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If each KAO has the KID I think it should be fine. It seems like the TODO should be to update this function with that knowledge? And we probably need some xtest test added to validate how it works across SDKs currently.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

From what JP said in slack, this ticket didn't really need a "fix" it just needed to have the TODO removed from anything client facing, I can update the PR if that isn't all that should be done, I also have another PR to check the whole codebase for other TODOs in a similar vein

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yeah, I mean I don't want to misdirect with the TODO. I'm pretty sure using no split ids is not correct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants