Status Update
Comments
mk...@google.com <mk...@google.com> #2
Hi,
Thank you for taking the time to improve libphonenumber!
We are looking into this and will respond as soon as possible.
mk...@google.com <mk...@google.com> #3
Hi,
Thanks much for raising this issue. This is one of our known issue, which is not documented. Having phone numbers of this long are very rare. libphonenumber cannot do anything better here.
Reasons:
- JavaScript
Number
type has limitation of 2^53 (9007199254740992) as the max literal it can hold. When provided more than that like "90018408059449376"(17 digit), JS starts rounding the value. Unfortunately this is within the range of i.e 17 digit.possible phone number length - Both the alternatives leads to backward-incompatible changes as the type of the field '''national_number''' has to be changed; thus leading to client-side compile issue . Eg: setNationalNumber(1234) / conversions to payloads like JSON.
- Marking the field as
[jstype = JS_STRING]
- Or using new JS data type
BigInt
.
We will update FAQ at GitHub stating some of these points. Maybe you can compare with Number.MAX_VALUE and avoid such cases. Or post request to a Java/CPP/PY libphonenumber clients, as these langs have much more matured data type systems.
ap...@google.com <ap...@google.com> #5
wk...@google.com <wk...@google.com> #6
Hey, yesteday I said everything is working with that fix, but today I opened the same project in Android Studio 4.0 (I was trying with 4.1 previously) and it seems like there are some differences, as on 4.0 autocomplete still doesn't work :(
mk...@google.com <mk...@google.com> #7
Can you share the updated project, then I will take a look.
wk...@google.com <wk...@google.com> #8
huh, I must have had Studio in some weird state, but I did try to clean everything multiple times. Today I updated R8, recompiled everything again, and everything shows up in autocomplete in the same AS4.0 version. Might have been something wrong on my end
mk...@google.com <mk...@google.com> #9
Thank you for trying out again Wojtek. Do not hesitate to reach out if the problem resurfaces.
Description
Turns out IntelliJ is very picky about package name or/and extra modifiers in the metadata, resulting in very poor developer experience. Basically, the error is that we would produce:
where the kotlinc generated one would be:
If the data is not present, the kotlin.Metadata will print default values, where we then end up emitting those:
That also means we cannot distinguish between a null value or a default value. We should file an issue on jetbrains to figure out if this is intended behavior.