Skip to content

Conversation

@yuvaraj-quest1
Copy link
Collaborator

@yuvaraj-quest1 yuvaraj-quest1 commented Nov 24, 2025

Ditto Web Chat – Milestone 2 Completion

This PR completes Milestone 2 of the Ditto Web Chat project.
 It includes comprehensive unit test coverage, subscription management, notification system, reaction support, user mentions, dark theme implementation, profile picture rendering, security improvements and CI/CD pipelines.


Features Delivered

  1. Unit Test Cases – Comprehensive test coverage (~90%+) for both DittoChatCore and DittoChatUI SDKs.
  2. Subscription Rooms – Full implementation of room subscription/unsubscription functionality.
  3. Notifications and Badges – Real-time notification system with unread message badges and mention badges across subscribed rooms and DMs.
  4. Reaction Emojis – Complete reaction picker feature allowing users to add, remove, and display emoji reactions on messages.
  5. User Mentions – Comprehensive mention functionality with autocomplete support for tagging users in messages.
  6. Dark Theme – Complete dark mode implementation with automatic system theme detection and theme-switching capabilities.
  7. Profile Pictures – Full profile picture rendering support across chat lists, DMs, and user mentions with thumbnail optimization.
  8. Message Retention – Retention days logic implementation for automatic message cleanup.
  9. Security & Compliance – OWASP dependency validation, security vulnerability fixes (glob package), and automated security scanning.
  10. CI/CD Pipelines – GitHub Actions workflows for automated test case execution and OWASP security checks.

Issues Resolved

yuvaraj-quest1 and others added 30 commits November 7, 2025 11:06
…message & edit cancel on esc added & chat logout function added
…message & edit cancel on esc added & chat logout function added
Comment on lines 116 to 117
--disableSwiftPackageManagerAnalyzer
--disableSwiftPackageResolvedAnalyzer
Copy link
Member

Choose a reason for hiding this comment

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

@ErikEverson potential integration in the future?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah

Copy link
Member

Choose a reason for hiding this comment

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

I'd like input from @ErikEverson I think. Offhand I don't think a bunch of booleans is more scalable than a list of permissions, but I don't have a good grasp of our needs in this respect

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah actually the most scaleable way we could do this is to have an enum of permissions and then an array of permissions could be used. This means that we get enum safety when we add a new permission and we also get the convenience of not having to add a new boolean and update every place in the code that it is used as well.

Copy link
Member

Choose a reason for hiding this comment

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

@ErikEverson This probably needs to align with our colors, right? At least eventually

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes we will want this to align with the color stuff from forge as it is a really robust system. I think this is something to refactor when we get the color system finalized in Forge.

Copy link
Member

Choose a reason for hiding this comment

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

Is there a reason we didn't go for an off the shelf solution for toasts like https://github.com/emilkowalski/sonner?

Copy link
Collaborator

Choose a reason for hiding this comment

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

We considered using an off-the-shelf toast library like Sonner, but for this project we wanted to minimize external dependencies and keep the UI layer purely Tailwind-driven. Since our toast requirements were fairly simple, we opted to implement a lightweight custom Toast component instead.

Copy link
Member

Choose a reason for hiding this comment

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

I think it would be more maintainable long term to not re-invent things where possible. The unpacked size of something like sonner is pretty negligible for modern web applications (166kb for sonner specifically) and I'd argue that a headless UI component not only satisfies your desire to keep the UI layer purely Tailwind-driven but is more ideal since you still get complete control over styling and animations while the library handles the complex orchestration details as our needs grow (promises, ARIA, more queue management, etc).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Added the sonner package and removed our custom toaster implementation.

We also introduced a new option that allows consumers to pass their own custom notification function through props. This gives integrators full control—if they want to handle notifications in their own way, they can simply provide a function that receives the notification details and display it however they prefer in the parent app.

If no custom function is provided, we fall back to using sonner by default to show notifications.

@getditto getditto deleted a comment from github-actions bot Dec 3, 2025
@getditto getditto deleted a comment from github-actions bot Dec 3, 2025
@getditto getditto deleted a comment from github-actions bot Dec 3, 2025
@getditto getditto deleted a comment from github-actions bot Dec 3, 2025
@github-actions
Copy link

github-actions bot commented Dec 3, 2025

🟢 Test Coverage Report - sdks/js/DittoChatCore

Overall Coverage: 92.42%

Metric Coverage Status
🟢 Lines 93.78% green
🟢 Statements 93.78% green
🟢 Functions 95.83% green
🟢 Branches 86.31% green

📊 View Detailed Coverage Report

ℹ️ Coverage Thresholds
  • 🟢 Excellent (≥ 80%)
  • 🟡 Good (60-79%)
  • 🟠 Fair (40-59%)
  • 🔴 Poor (< 40%)

@github-actions
Copy link

github-actions bot commented Dec 3, 2025

🟢 Test Coverage Report - sdks/js/DittoChatUI

Overall Coverage: 91.11%

Metric Coverage Status
🟢 Lines 92.53% green
🟢 Statements 92.53% green
🟢 Functions 90.56% green
🟢 Branches 88.8% green

📊 View Detailed Coverage Report

ℹ️ Coverage Thresholds
  • 🟢 Excellent (≥ 80%)
  • 🟡 Good (60-79%)
  • 🟠 Fair (40-59%)
  • 🔴 Poor (< 40%)

@github-actions
Copy link

github-actions bot commented Dec 3, 2025

⚠️ OWASP Dependency Check - sdks/js/DittoChatUI

Medium severity vulnerabilities detected

Severity Count
🔴 Critical 0
🟠 High 0
🟡 Medium 1
🔵 Low 0
Total 1

📋 Vulnerability Details

  • CVE-2025-64718 (MEDIUM) in js-yaml:3.14.2
    • Description: js-yaml is a JavaScript YAML parser and dumper. In js-yaml 4.1.0 and below, it's possible for an attacker to modify the prototype of the result of a parsed yaml document via prototype pollution ( proto ). All users who parse untrusted yaml documents may be impacted. The problem is patched in js-yaml 4.1.1. Users can protect against this kind of attack on the server by using node --disable-proto=delete or deno (in Deno, pollution protection is on by default).
    • CVSS: 5.3

📊 View Full HTML Report

ℹ️ How to fix vulnerabilities
  1. Update vulnerable dependencies to patched versions
  2. Run npm audit fix or npm audit fix --force
  3. Check for alternative packages if updates aren't available
  4. Review and update your package.json and package-lock.json

@github-actions
Copy link

github-actions bot commented Dec 3, 2025

⚠️ OWASP Dependency Check - sdks/js/DittoChatCore

Medium severity vulnerabilities detected

Severity Count
🔴 Critical 0
🟠 High 0
🟡 Medium 1
🔵 Low 0
Total 1

📋 Vulnerability Details

  • CVE-2025-64718 (MEDIUM) in js-yaml:3.14.2
    • Description: js-yaml is a JavaScript YAML parser and dumper. In js-yaml 4.1.0 and below, it's possible for an attacker to modify the prototype of the result of a parsed yaml document via prototype pollution ( proto ). All users who parse untrusted yaml documents may be impacted. The problem is patched in js-yaml 4.1.1. Users can protect against this kind of attack on the server by using node --disable-proto=delete or deno (in Deno, pollution protection is on by default).
    • CVSS: 5.3

📊 View Full HTML Report

ℹ️ How to fix vulnerabilities
  1. Update vulnerable dependencies to patched versions
  2. Run npm audit fix or npm audit fix --force
  3. Check for alternative packages if updates aren't available
  4. Review and update your package.json and package-lock.json

Copy link
Collaborator

@ErikEverson ErikEverson left a comment

Choose a reason for hiding this comment

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

One thing to think about with RBAC

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah actually the most scaleable way we could do this is to have an enum of permissions and then an array of permissions could be used. This means that we get enum safety when we add a new permission and we also get the convenience of not having to add a new boolean and update every place in the code that it is used as well.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes we will want this to align with the color stuff from forge as it is a really robust system. I think this is something to refactor when we get the color system finalized in Forge.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants