Malformed hostname can cause a crash.
Activity
CB robot May 3, 2022 at 5:21 PM
Build couchbase-lite-android-3.1.0-242 contains couchbase-lite-java-ee-root commit 06fa04b with commit message:
https://couchbasecloud.atlassian.net/browse/CBL-3055#icft=CBL-3055: Better handling of failure creating SocketFromCore
CB robot May 3, 2022 at 5:21 PM
Build couchbase-lite-android-3.1.0-242 contains couchbase-lite-java-common commit eec9c86 with commit message:
https://couchbasecloud.atlassian.net/browse/CBL-3055#icft=CBL-3055: Better handling of failure creating SocketFromCore (#74)
CB robot May 3, 2022 at 4:40 PM
Build couchbase-lite-java-3.1.0-233 contains couchbase-lite-java-ee-root commit 06fa04b with commit message:
https://couchbasecloud.atlassian.net/browse/CBL-3055#icft=CBL-3055: Better handling of failure creating SocketFromCore
CB robot May 3, 2022 at 4:40 PM
Build couchbase-lite-java-3.1.0-233 contains couchbase-lite-java-common commit eec9c86 with commit message:
https://couchbasecloud.atlassian.net/browse/CBL-3055#icft=CBL-3055: Better handling of failure creating SocketFromCore (#74)
A malformed hostname can cause the AbstractC4WebSocket constructor to throw and exception. This is eventually translated to a UnsupportedOperationException thrown by SocketFactory to C4Socket.open.
This is one of several ways that the latter method can receive an exception and it has no way at all to cope with any of them.
In particular, it will not tell Core that the open failed and will not, immediately dispose of the LiteCore peer object.
Any uncaught exception while core is attempting to open a connection to the remote will cause the app to crash. I think that a combination of Core timeout and a finalizer on the Java socket object keep this from being a serious problem for exceptions that are caught.