Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • briar briar
  • Project information
    • Project information
    • Activity
    • Labels
    • Planning hierarchy
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 782
    • Issues 782
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 8
    • Merge requests 8
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • briar
  • briarbriar
  • Issues
  • #2255

Closed
Open
Created Jan 20, 2022 by Sebastian@sebkurDeveloper

Improve ContactExistsException

When Alice adds an existing proper contact again via briar:// link, we throw a ContactExistsException that is used to show warnings to her to warn about a potential attack that might be in progress with one of the contacts trying to discover her contacts or non-contacts. The exception carries the local AuthorId as well as the remote Author so that a warning message can explain to Alice who the involved contacts are. However it lacks the alias Alice might have given to the existing contact. The result is that only the original self-given name of the contact can be displayed in warnings. I think this might confuse Alice as the contact name displayed in the warning can be different from the name displayed in her contact list and also can be rather ambiguous.

I propose we add the alias to the ContactExistsException. Among the three places where this exception gets created, in one place (in DatabaseComponentImpl#addPendingContact()) we already have the existing contact retrieved from the db readily available and could set the additional data right away. In the two other places (in DatabaseComponentImpl#addContact()), we don't yet have the contact retrieved. Instead we checked containsIdentity() and/or containsContact() there. I think we could either just retrieve the existing contact additionally there, shouldn't be a huge burden in terms of performance. We could also leave out the containsContact() check and just check if the contact retrieved is != null. Maybe we can even leave out the containsIdentity() in this case? Either way I think performance shouldn't be an issue.

Assignee
Assign to
Time tracking