Skip to content

Conversation

@hermanliang
Copy link
Contributor

ParseLiveQueryClient<ParseObject> parseLiveQueryClient = ParseLiveQueryClient.Factory.getClient();

Get ws URI directly from server URL
ex.

Copy link
Contributor

@mmimeault mmimeault left a comment

Choose a reason for hiding this comment

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

Some questions

this(null);
URL serverUrl = ParseRESTCommand.server;
if (serverUrl == null) {
throw new RuntimeException("serverUrl is null. "
Copy link
Contributor

Choose a reason for hiding this comment

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

checkInit is already called in the other constructor to do that check.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

} catch (URISyntaxException e) {
e.printStackTrace();
throw new RuntimeException(e.getMessage());
}
Copy link
Contributor

Choose a reason for hiding this comment

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

You could extract that logic into a static util

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed by 1040abb

private final String clientKey;
private final SparseArray<Subscription<? extends ParseObject>> subscriptions = new SparseArray<>();
private final URI uri;
private URI uri;
Copy link
Contributor

Choose a reason for hiding this comment

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

You should keep it final, and only pass the result WSS URL when it's parsed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fix it
Thanks


private static URI getDefaultUri() {
URL serverUrl = ParseRESTCommand.server;
if (serverUrl != null) {
Copy link
Contributor

Choose a reason for hiding this comment

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

minor change, but i'd return null serverUrl == null and then take this out of an if block

Copy link
Contributor Author

Choose a reason for hiding this comment

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

changed by d50da48
Thanks 😄

@rogerhu rogerhu merged commit 3368d33 into parse-community:master Mar 27, 2017
@hermanliang hermanliang deleted the ws-uri-from-server-url branch March 30, 2017 03:21
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.

3 participants