Skip to content

api!: get rid of Qr::FprWithoutAddr and Qr::FprMismatch variants - #8719

Merged
link2xt merged 1 commit into
mainfrom
link2xt/remove-qr-fpr-without-addr
Sep 22, 2026
Merged

link2xt merged 1 commit into
mainfrom
link2xt/remove-qr-fpr-without-addr

Conversation

@link2xt

@link2xt link2xt commented Sep 19, 2026 •

Copy link
Copy Markdown
Collaborator

We don't look at the address in OPENPGP4FPR QR codes anymore.
If we cannot find a contact by fingerprint,
then we return an error without trying to look up
the contact by address.

Scanning OPENPGP4FPR can now only return FprOk
if matching key-contact is found, or an error.

BREAKING CHANGE: removed DC_QR_FPR_WITHOUT_ADDR and DC_QR_FPR_MISMATCH constants from CFFI
BREAKING CHANGE: removed FprWithoutAddr and FprMismatch variants from JSON-RPC QrObject returned by check_qr

@link2xt
link2xt force-pushed the link2xt/remove-qr-fpr-without-addr branch 3 times, most recently from b2c86b8 to 527570b Compare September 19, 2026 18:24
@link2xt
link2xt marked this pull request as ready for review September 19, 2026 18:26
@link2xt
link2xt requested review from Hocuri and r10s September 21, 2026 15:11
@Hocuri

Hocuri commented Sep 21, 2026

Copy link
Copy Markdown
Collaborator

Since we're on it, can we remove FprMismatch, too, and just return an error instead? What Android does is show The scanned fingerprint does not match the last seen for {email address}., which is weird since we're moving towards addresses becoming irrelevant.

@link2xt
link2xt force-pushed the link2xt/remove-qr-fpr-without-addr branch from 527570b to 0c28ecf Compare September 21, 2026 17:42
Comment thread src/qr.rs
let (contact_id, _) =
Contact::add_or_lookup_ext(context, "", addr, &fingerprint, Origin::UnhandledQrScan)
.await?;
let contact = Contact::get_by_id(context, contact_id).await?;

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Removed checking for the public key while removing FprMismatch, so it is now possible to get FprOk that points to the chat where you cannot send if you somehow added a key contact without the key. I did not want to return a separate error for the case when the contact exists, but has no key. I think it's fine because fingerprint-only QR codes are not really used anyway.

@link2xt link2xt changed the title api!: get rid of Qr::FprWithoutAddr variant api!: get rid of Qr::FprWithoutAddr and Qr::FprMismatch variants Sep 21, 2026
@link2xt link2xt changed the title api!: get rid of Qr::FprWithoutAddr and Qr::FprMismatch variants api!: get rid of Qr::FprWithoutAddr and Qr::FprMismatch variants Sep 21, 2026

@Hocuri Hocuri left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Nice to remove some more historical baggage!

"BREAKING CHANGES:" footer in the Commit message needs to be updated since both variants are removed now

We don't look at the address in OPENPGP4FPR QR codes anymore.
If we cannot find a contact by fingerprint,
then we return an error without trying to look up
the contact by address.

Scanning OPENPGP4FPR can now only return FprOk
if matching key-contact is found, or an error.

BREAKING CHANGE: removed DC_QR_FPR_WITHOUT_ADDR and DC_QR_FPR_MISMATCH constants from CFFI
BREAKING CHANGE: removed FprWithoutAddr and FprMismatch variants from JSON-RPC QrObject returned by check_qr
@link2xt
link2xt force-pushed the link2xt/remove-qr-fpr-without-addr branch from 0c28ecf to 8fe31cc Compare September 22, 2026 11:51
@link2xt
link2xt merged commit 3de65e4 into main Sep 22, 2026
30 checks passed
@link2xt
link2xt deleted the link2xt/remove-qr-fpr-without-addr branch September 22, 2026 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants