Closed r10s closed 4 years ago
so, might be that dc_add_address_book() is buggy.
I found a bug in add_or_create_contact
i investigated a bit:
the problem is a contact in the database that has an unknown origin - for whatever reason, however, this can easily happen (in my case, the contact has the origin 0x100000 which was probably used some time ago)
as a result, Contact::add_or_lookup()
fails when parsing the returned row at let row_origin = row.get(3)?;
which makes the whole SELECT-statement failing - the following lines assume the contact just does not exist and insert a duplicate then, which is bad.
i suggest that impl FromSql for Origin
should not result in an error but just return Unknown
. this would also fix the problem for similar situations.
the contact list shows several contacts multiple times.
not yet sure if they're really duplicated in the database of if dc_get_contacts() is buggy.EDIT: they're really duplicated in the database. eg. times several bob@librechat.net in my case (nb: the "original" entry hasid=5077, origin=1048576=0x1000000=DC_ORIGIN_SECUREJOIN_INVITED, name=Bob; the duplicates have
id>7000, origin=524288=0x80000=DC_ORIGIN_ADRESS_BOOK) and name set to email address (not empty).