Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

Unused field 'device_id' in session_pre_key_bundle #55

Closed
gkdr opened this issue Mar 15, 2017 · 2 comments
Closed

Unused field 'device_id' in session_pre_key_bundle #55

gkdr opened this issue Mar 15, 2017 · 2 comments

Comments

@gkdr
Copy link

gkdr commented Mar 15, 2017

I figured this is for legacy reasons, but since you were talking about a to-do list for cleaning up the code in similar issues I think this should go on it as well.

session_pre_key_bundle_create() takes the parameter device_id, which as far as I can tell (Eclipse reference search), is never used.
Especially session_builder_process_pre_key_bundle(), which seems to be the only function that deals with the bundle, does not use it.
It seems registration_id (of proper uint32_t instead of just int) is used instead.

While not tragic, it creates some confusion about how to properly call session_pre_key_bundle_create() and should be included in an overhaul.

(As a sidenote, do you take pull requests with just documentation comments?)

@dkonigsberg
Copy link
Contributor

It appears that the explanation here is the same as for the other case you noticed... "Because the Java version has it."

The C library was initially developed with a goal of matching the API of the Java library whenever possible. If you want to know why the Java library does something, you'll need to ask @moxie0 perhaps via the mailing list.

@ma11hew28
Copy link

ma11hew28 commented Oct 31, 2019

@gkdr great find. I just reported the same issue on the Java library.

signalapp/libsignal-protocol-java#60

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

3 participants