##// END OF EJS Templates
goto-switcher: optimized performance and query capabilities....
goto-switcher: optimized performance and query capabilities. - Previous implementation had on significant bug. The use of LIMIT 20 was limiting results BEFORE auth checks. In case of large ammount of similarly named repositories user didn't had access too, the result goto search was empty. This was becuase first 20 items fetched didn't pass permission checks and final auth list was empty. To fix this we now use proper filtering for auth using SQL. It means we first check user allowed repositories, and add this as a filter so end result from database is already to only the accessible repositories.

File last commit:

r787:048ecbf3 default
r2038:2bdf9d4d default
Show More
channelstream-connection.html
106 lines | 3.7 KiB | text/html | HtmlLexer
<link rel="import" href="../../../../../../bower_components/polymer/polymer.html">
<link rel="import" href="../../../../../../bower_components/iron-ajax/iron-ajax.html">
<!--
`<channelstream-connection>` allows you to connect and interact with channelstream server
abstracting websocket/long-polling connections from you.
In typical use, just slap some `<channelstream-connection>` at the top of your body:
<body>
<channelstream-connection
username="{{user.username}}"
connect-url="http://127.0.0.1:8000/demo/connect"
disconnect-url="http://127.0.0.1:8000/disconnect"
subscribe-url="http://127.0.0.1:8000/demo/subscribe"
message-url="http://127.0.0.1:8000/demo/message"
long-poll-url="http://127.0.0.1:8000/listen"
websocket-url="http://127.0.0.1:8000/ws"
channels-url='["channel1", "channel2"]' />
Then you can do `channelstreamElem.connect()` to kick off your connection.
This element also handles automatic reconnections.
## Default handlers
By default element has a listener attached that will fire `startListening()` handler on `channelstream-connected` event.
By default element has a listener attached that will fire `retryConnection()` handler on `channelstream-connect-error` event,
this handler will forever try to re-establish connection to the server incrementing intervals between retries up to 1 minute.
-->
<dom-module id="channelstream-connection">
<template>
<iron-ajax
id="ajaxConnect"
url=""
handle-as="json"
method="post"
content-type="application/json"
loading="{{loadingConnect}}"
last-response="{{connectLastResponse}}"
on-response="_handleConnect"
on-error="_handleConnectError"
debounce-duration="100"></iron-ajax>
<iron-ajax
id="ajaxDisconnect"
url=""
handle-as="json"
method="post"
content-type="application/json"
loading="{{loadingDisconnect}}"
last-response="{{_disconnectLastResponse}}"
on-response="_handleDisconnect"
debounce-duration="100"></iron-ajax>
<iron-ajax
id="ajaxSubscribe"
url=""
handle-as="json"
method="post"
content-type="application/json"
loading="{{loadingSubscribe}}"
last-response="{{subscribeLastResponse}}"
on-response="_handleSubscribe"
debounce-duration="100"></iron-ajax>
<iron-ajax
id="ajaxUnsubscribe"
url=""
handle-as="json"
method="post"
content-type="application/json"
loading="{{loadingUnsubscribe}}"
last-response="{{unsubscribeLastResponse}}"
on-response="_handleUnsubscribe"
debounce-duration="100"></iron-ajax>
<iron-ajax
id="ajaxMessage"
url=""
handle-as="json"
method="post"
content-type="application/json"
loading="{{loadingMessage}}"
last-response="{{messageLastResponse}}"
on-response="_handleMessage"
on-error="_handleMessageError"
debounce-duration="100"></iron-ajax>
<iron-ajax
id="ajaxListen"
url=""
handle-as="text"
loading="{{loadingListen}}"
last-response="{{listenLastResponse}}"
on-request="_handleListenOpen"
on-error="_handleListenError"
on-response="_handleListenMessageEvent"
debounce-duration="100"></iron-ajax>
</template>
<script src="channelstream-connection.js"></script>
</dom-module>