Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • briar briar
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 784
    • Issues 784
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 10
    • Merge requests 10
  • 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
  • briarbriar
  • briarbriar
  • Merge requests
  • !1174

[android] Fix duplicate items in lists

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Torsten Grote requested to merge 1210-fix-list-duplicates into master Oct 15, 2019
  • Overview 3
  • Commits 1
  • Pipelines 1
  • Changes 4

When doing reloads of list items (such as when adding test contacts), we loaded different versions of those items and added them to the list.

According to the documentation of add():

If the sorting criteria of the item is changed, SortedList won't be able to find its duplicate in the list which will result in having a duplicate of the Item in the list.

Int he case of the contact list, new contacts caused reloads of the entire list and new messages caused the contacts to be sorted differently. Thus we ended up with duplicate contacts in the list.

This commit fixes this by replacing the contacts in the list instead of adding them. It applies the same fix to forums and private groups which use the same logic and are thus also affected.

Closes #1210 (closed)

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: 1210-fix-list-duplicates