Announcement Announcement Module
No announcement yet.
Field rank in Connection object Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Field rank in Connection object


    My application needs to manage several connection for the same provider for one user of my application.

    Among these Connection, I'd like to let my user which one is the "primary" connection (ie. the one returned by ConnectionRepository.getPrimaryConnection(apiType) , or the one with rank=1).

    But from what I read in the documentation and in the code, there is no such functionality (changing the rank of a Connection, the rank field does not seem to be accessible).

    Besides if the user remove the Connection with the rank 1, future calls to ConnectionRepository.getPrimaryConnection(apiType) will throw an exception, even if there is still a Connection of the type apiType.

    Am I correct?

    Thanks you very much

  • #2
    Re-ranking of connections is not are correct. If this is something important to you, then I encourage you to open an improvement issue at ( and we'll try to work it into the mix.

    As for an exception thrown from getPrimaryConnection() if connection 1 is removed...that sounds like a bug. Can you confirm for me that it happens and, if so, open a bug issue for it?


    • #3
      Here is the bug issue regarding the exception thrown from getPrimaryConnection():

      Considering this bug and the fact that I need to choose the primary connection, here is what I do in my application
      • never use get/findPrimaryConnection. Instead call findConnections(ProviderId), and pick the first one (as connections are sorted by rank)
      • I added a method to change the connection with rank 1 :
        • first, update the primary connection with rank = max(rank) +1
        • then, update the connection with the right providerUserId with rank =1